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

Function split_list

union/D3L/webtable_small_query_second.py:17–31  ·  view source on GitHub ↗
(lst, num_parts)

Source from the content-addressed store, hash-verified

15import time
16
17def split_list(lst, num_parts):
18 avg = len(lst) // num_parts
19 remainder = len(lst) % num_parts
20
21 result = []
22 start = 0
23 for i in range(num_parts):
24 if i < remainder:
25 end = start + avg + 1
26 else:
27 end = start + avg
28 result.append(lst[start:end])
29 start = end
30
31 return result
32
33def sub_process(query_tables, queue):
34 for i, table_name_with_extension in enumerate(query_tables):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected