code: def get_code_hash(step: Entity) -> str:
      """Get the hash of the code artifact(s) for the given step
  
      Args:
          step (Entity): A pipeline step object (Entity type because Step causes circular import)
      Returns:
          str: A hash string representing the unique code artifact(s) for the step
      """
      from sagemaker.workflow.steps import ProcessingStep, TrainingStep
  
      if isinstance(step, ProcessingStep) and step.step_args:
          kwargs = step.step_args.func_kwargs
          source_dir = kwargs.get("source_dir")
          submit_class = kwargs.get("submit_class")
          dependencies = get_processing_dependencies(
              [
                  kwargs.get("dependencies"),
                  kwargs.get("submit_py_files"),
                  [submit_class] if submit_class else None,
                  kwargs.get("submit_jars"),
                  kwargs.get("submit_files"),
              ]
          )
          code = kwargs.get("submit_app") or kwargs.get("code")
  
          return get_processing_code_hash(
              code, source_dir, dependencies
          )
  
      if isinstance(step, TrainingStep) and step.step_args:
          job_obj = step.step_args.func_args[0]
          source_dir = job_obj.source_dir
          dependencies = job_obj.dependencies
          entry_point = job_obj.entry_point
  
          return get_training_code_hash(
              entry_point, source_dir, dependencies
          )
      return None
  
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 4 for calling a global function with example usage: get_code_hash(step) and returns: None, get_processing_code_hash, get_training_code_hash