MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / split_list

Function split_list

join/LSH/benchmark_all_top.py:93–107  ·  view source on GitHub ↗
(lst, num_parts)

Source from the content-addressed store, hash-verified

91
92
93def split_list(lst, num_parts):
94 avg = len(lst) // num_parts
95 remainder = len(lst) % num_parts
96
97 result = []
98 start = 0
99 for i in range(num_parts):
100 if i < remainder:
101 end = start + avg + 1
102 else:
103 end = start + avg
104 result.append(lst[start:end])
105 start = end
106
107 return result
108
109
110def _hash_32(d):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected