code: def hash_file(f):
      h = hashlib.sha256()
      with open(f, "rb") as f:
          # Read and update hash string value in blocks of 4K
          for byte_block in iter(lambda: f.read(4096), b""):
              h.update(byte_block)
      return h.hexdigest()
  
file_path: snakemake/snakemake/caching/hash.py
imports: import hashlib
  import json
  from snakemake.jobs import Job
  from snakemake import script
  from snakemake import wrapper
  from snakemake.exceptions import WorkflowError
  from snakemake.settings import DeploymentMethod
label_desc: Use image node_id 1 for calling a global function with example usage: hash_file(f) and returns: h