MCPcopy Index your code
hub / github.com/python/cpython / _calculate_ratio

Function _calculate_ratio

Lib/difflib.py:40–43  ·  view source on GitHub ↗
(matches, length)

Source from the content-addressed store, hash-verified

38Match = _namedtuple('Match', 'a b size')
39
40def _calculate_ratio(matches, length):
41 if length:
42 return 2.0 * matches / length
43 return 1.0
44
45class SequenceMatcher:
46

Callers 3

ratioMethod · 0.85
quick_ratioMethod · 0.85
real_quick_ratioMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…