code: def calculate_dir_hash(
      dir_path, hash_algo="md5", ignore: Union[str, List[str]] = None
  ):
      """Calculte the hash values of all files under the directory."""
      hashes = {}
      for dirpath, _, filenames in os.walk(dir_path):
          for filename in filenames:
              if ignore and filename in ignore:
                  continue
              filepath = os.path.join(dirpath, filename)
              file_hash = calculate_file_hash(
                  filepath, hash_algo=hash_algo
              )
              hashes[filepath] = file_hash
      return hashes
  
file_path: dgl/python/dgl/graphbolt/internal/utils.py
imports: import hashlib
  import json
  import os
  import shutil
  from typing import List, Union
  import numpy
  import pandas
  import torch
  from numpy.lib.format import read_array_header_1_0, read_array_header_2_0
label_desc: Use image node_id 10 for calling a global function with example usage: calculate_dir_hash(dir_path, hash_algo, ignore) and returns: hashes