code: def get_file_hash(filename, algorithm="sha256"):
      """find the SHA256 hash string of a file. We use this so that the
      user can choose to cache working directories in storage.
      """
      from snakemake.logging import logger
  
      # The algorithm must be available
      try:
          hasher = hashlib.new(algorithm)
      except ValueError as ex:
          logger.error("%s is not an available algorithm." % algorithm)
          raise ex
  
      with open(filename, "rb") as f:
          for chunk in iter(lambda: f.read(4096), b""):
              hasher.update(chunk)
      return hasher.hexdigest()
  
imports: import contextlib
  import itertools
  import math
  import operator
  import platform
  import hashlib
  import inspect
  import sys
  import uuid
  import os
  import asyncio
  import collections
  from pathlib import Path
  from snakemake._version import get_versions
  from snakemake_interface_common.exceptions import WorkflowError
label_desc: Use image node_id 14 for calling a global function with example usage: get_file_hash(filename, algorithm) and returns: hasher