code: def main(fname: str, outfile: Optional[str] = None) -> None:
      p = Path(fname).expanduser()
      hashes = compute_hashes(p)
  
      if outfile is None:
          outfile = p.with_suffix(p.suffix + ".md5").open(
              "w", encoding="utf-8"
          )
      elif outfile == "-":
          outfile = sys.stdout
      else:
          outfile = (
              Path(outfile).expanduser().open("w", encoding="utf-8")
          )
  
      for fname, fhash in hashes.items():
          print(f"{fhash} *{fname}", file=outfile, flush=True)
  
      if outfile is not sys.stdout:
          outfile.close()
  
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 5 for calling a global function with example usage: main(fname, outfile) without return types