MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / _find_ranges

Method _find_ranges

utils/src/multimodal.py:91–106  ·  view source on GitHub ↗

Find consecutive ranges in a list of numbers.

(self, numbers)

Source from the content-addressed store, hash-verified

89 stats["top_ranges_str"] = top_ranges_str
90
91 def _find_ranges(self, numbers):
92 """
93 Find consecutive ranges in a list of numbers.
94 """
95 ranges = []
96 start = numbers[0]
97 end = numbers[0]
98 for num in numbers[1:]:
99 if num == end + 1:
100 end = num
101 else:
102 ranges.append((start, end))
103 start = num
104 end = num
105 ranges.append((start, end))
106 return ranges

Callers 1

collect_imagesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected