code: def tar_md5(
      fpath: Union[str, Path], chunk_size: int = 2**16
  ) -> Dict[str, str]:
      tar = tarfile.open(fpath)
      res = {}
      while True:
          item: tarfile.TarInfo = tar.next()
          if item is None:
              break
          if not item.isfile():
              continue
          file_hash = md5()
          with tar.extractfile(item) as f:
              for chunk in iter(lambda: f.read(chunk_size), b""):
                  file_hash.update(chunk)
          res[item.name] = file_hash.hexdigest()
      return res
  
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 1 for calling a global function with example usage: tar_md5(fpath, chunk_size) and returns: res