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

Function check_files_md5_parallel

utils/src/experiment/crawler.py:298–309  ·  view source on GitHub ↗
(directory: str, num_workers: int = 8)

Source from the content-addressed store, hash-verified

296
297
298def check_files_md5_parallel(directory: str, num_workers: int = 8):
299 filepaths = []
300 for root, _, files in os.walk(directory):
301 for file in files:
302 if file.endswith(".pptx") or file.endswith(".pdf"):
303 filepaths.append(os.path.join(root, file))
304 with ProcessPoolExecutor(max_workers=num_workers) as executor:
305 result = list(executor.map(verify_md5, filepaths))
306 with jsonlines.open("incorrect_files.jsonl", mode="w") as writer:
307 for i in result:
308 if i is not None:
309 writer.write(i)
310
311
312def dataset_stat():

Callers 1

crawler.pyFile · 0.70

Calls 1

walkMethod · 0.45

Tested by

no test coverage detected