code: def _hash_file(file: Union[str, Path], md5: Hash) -> Hash:
      """Updates the inputted Hash with the contents of the current path.
  
      Args:
          file: path of the file
      Returns:
          str: The MD5 hash of the file
      """
      if isinstance(file, str) and file.lower().startswith("file://"):
          file = unquote(urlparse(file).path)
      if not Path(file).is_file():
          raise ValueError(str(file) + " is not a valid file")
      with open(file, "rb") as f:
          while True:
              data = f.read(BUF_SIZE)
              if not data:
                  break
              md5.update(data)
      return md5
  
imports: from __future__ import absolute_import
  import inspect
  import logging
  from functools import wraps
  from pathlib import Path
  from typing import List, Sequence, Union, Set, TYPE_CHECKING, Optional
  import hashlib
  from urllib.parse import unquote, urlparse
  from contextlib import contextmanager
  from _hashlib import HASH
  from sagemaker.utils import base_from_name
  from sagemaker.workflow.parameters import Parameter
  from sagemaker.workflow.pipeline_context import _StepArguments, _PipelineConfig
  from sagemaker.workflow.entities import Entity, RequestType
  from sagemaker.workflow.pipeline_definition_config import PipelineDefinitionConfig
label_desc: Use image node_id 14 for calling a global function with example usage: _hash_file(file, md5) and returns: md5