code: def hash_file(fpath, algorithm="sha256", chunk_size=65535):
      """Calculates a file sha256 or md5 hash.
  
      Example:
  
      >>> hash_file('/path/to/file.zip')
      'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
  
      Args:
          fpath: Path to the file being validated.
          algorithm: Hash algorithm, one of `"auto"`, `"sha256"`, or `"md5"`.
              The default `"auto"` detects the hash algorithm in use.
          chunk_size: Bytes to read at a time, important for large files.
  
      Returns:
          The file hash.
      """
      if isinstance(algorithm, str):
          hasher = resolve_hasher(algorithm)
      else:
          hasher = algorithm
  
      with open(fpath, "rb") as fpath_file:
          for chunk in iter(lambda: fpath_file.read(chunk_size), b""):
              hasher.update(chunk)
  
      return hasher.hexdigest()
  
imports: import hashlib
  import os
  import pathlib
  import re
  import shutil
  import tarfile
  import urllib
  import warnings
  import zipfile
  from urllib.request import urlretrieve
  from keras.api_export import keras_export
  from keras.backend import config
  from keras.utils import io_utils
  from keras.utils.module_utils import gfile
  from keras.utils.progbar import Progbar
label_desc: Use image node_id 9 for calling a global function with example usage: hash_file(fpath, algorithm, chunk_size) and returns: hasher