code: def _get_component_image(
      default_image: Union[str, Mapping[str, str]], component_id: str
  ) -> str:
      """Gets component image path given component_id."""
      if isinstance(default_image, str):
          return default_image
  
      if (
          component_id not in default_image
          and DEFAULT_IMAGE_PATH_KEY not in default_image
      ):
          raise ValueError(
              f"Any of component id {component_id} or default key must be found "
              "in default_image map."
          )
  
      return default_image.get(
          component_id, default_image[DEFAULT_IMAGE_PATH_KEY]
      )
  
imports: import random
  import re
  import string
  import typing
  from typing import Any, Dict, List, Mapping, Optional, Union
  from absl import logging
  from kfp.pipeline_spec import pipeline_spec_pb2
  from tfx.dsl.components.base import base_node
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types
  from tfx.orchestration import pipeline
  from tfx.orchestration.kubeflow import utils
  from tfx.orchestration.kubeflow.v2 import compiler_utils
  from tfx.orchestration.kubeflow.v2 import parameter_utils
  from tfx.orchestration.kubeflow.v2 import step_builder
  from tfx.types import channel_utils
  from google.protobuf import json_format
label_desc: Use image node_id 3 for calling a global function with example usage: _get_component_image(default_image, component_id) and returns: default_image, default_image