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

Function split_list

join/LSH/union wl.py:72–86  ·  view source on GitHub ↗
(lst, num_parts)

Source from the content-addressed store, hash-verified

70 q.put((datas,))
71
72def split_list(lst, num_parts):
73 avg = len(lst) // num_parts
74 remainder = len(lst) % num_parts
75
76 result = []
77 start = 0
78 for i in range(num_parts):
79 if i < remainder:
80 end = start + avg + 1
81 else:
82 end = start + avg
83 result.append(lst[start:end])
84 start = end
85
86 return result
87
88
89if __name__ == "__main__":

Callers 1

union wl.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected