def path_total_size(path_: str) -> int:
    """Compute total size of the given file/dir."""
    if path.isfile(path_):
        return path.getsize(path_)
    total_size = 0
    for root_dir, _, files in os.walk(path_):
        for file_ in files:
            total_size += path.getsize(path.join(root_dir, file_))
    return total_size
def path_total_size ( path_ : str ) -> int : if path . isfile ( path_ ) : return path . getsize ( path_ ) total_size = 0 for root_dir , _ , files in os . walk ( path_ ) : for file_ in files : total_size += path . getsize ( path . join ( root_dir , file_ ) ) return total_size
Compute total size of the given file/dir.