aac_datasets.utils.download module¶
- hash_file( ) str [source]¶
Return the hash value for a file.
BASED ON https://github.com/pytorch/audio/blob/v0.13.0/torchaudio/datasets/utils.py#L110
- safe_rmdir(
- root: str | Path,
- rm_root: bool = True,
- error_on_non_empty_dir: bool = True,
- followlinks: bool = False,
- verbose: int = 0,
Remove all empty sub-directories.
- Parameters:
root – Root directory path.
rm_root – If True, remove the root directory too. defaults to True.
error_on_non_empty_dir – If True, raises a RuntimeError if a subdirectory contains at least 1 file. Otherwise it will leave non-empty directories. defaults to True.
followlinks – Indicates whether or not symbolic links shound be followed. defaults to False.
verbose – Verbose level. defaults to 0.
- Returns:
The list of directories paths deleted.