code: def compute_hashes(fpath: Union[str, Path]) -> Dict[str, str]:
      p = Path(fpath).expanduser()
      if not p.is_file():
          raise RuntimeError(f"{p} is not a file")
  
      if ".tar" in {s.lower() for s in p.suffixes}:
          hashes = tar_md5(p)
      elif p.suffix.lower() == ".gz":
          hashes = {p.with_suffix("").name: gzip_md5(p)}
      elif p.suffix.lower() == ".zip":
          hashes = zip_md5(p)
      else:
          hashes = {p.name: file_md5(p)}
      return hashes
  
file_path: DeepPavlov/utils/prepare/hashes.py
imports: import argparse
  import gzip
  import sys
  import tarfile
  from hashlib import md5
  from pathlib import Path
  from typing import Dict, Optional, Union
  from zipfile import ZipFile
  from deeppavlov.core.data.utils import file_md5
label_desc: Use image node_id 4 for calling a global function with example usage: compute_hashes(fpath) and returns: hashes