Extract tar file with progress tracking
(tar_path, output_dir)
| 426 | |
| 427 | |
| 428 | def extract_tar(tar_path, output_dir): |
| 429 | """Extract tar file with progress tracking""" |
| 430 | try: |
| 431 | with tarfile.open(tar_path) as tar: |
| 432 | members = tar.getmembers() |
| 433 | with tqdm(total=len(members), desc="Extracting files") as pbar: |
| 434 | for member in members: |
| 435 | tar.extract(member, path=output_dir) |
| 436 | pbar.update(1) |
| 437 | print(f"Successfully extracted to: {output_dir}") |
| 438 | except Exception as e: |
| 439 | raise RuntimeError(f"Extraction failed: {e!s}") |
| 440 | |
| 441 | |
| 442 | def set_random_seed(seed: int) -> None: |
no test coverage detected