code: def checksum(filepath, hash_prefix):
      """
      Check hash value of a file.
  
      Args:
          filepath (`str`): path of local file
          hash_prefix (`str`): prefix of hash value to compare with
      """
      with open(filepath, "rb") as f:
          len_prefix = len(hash_prefix)
          data = f.read()
          if (
              hashlib.sha256(data).hexdigest()[:len_prefix]
              == hash_prefix
          ):
              return True
          elif (
              hashlib.md5(data).hexdigest()[:len_prefix] == hash_prefix
          ):
              return True
          else:
              return False
  
imports: import hashlib
  import os
  from urllib import request
  import warnings
  from tqdm import tqdm
label_desc: Use image node_id 2 for calling a global function with example usage: checksum(filepath, hash_prefix) and returns: True, True, False