code: def parse_parameter_arg(
      arg: str,
      arg_defaults: Dict[str, Any],
      arg_typehint: Any,
      parameters: Dict[str, Any],
      arg_formats: Dict[str, ArgFormats],
  ) -> None:
      """Parses and validates a function arg annotated with Parameter[T].
  
      Args:
        arg: The arg name.
        arg_defaults: A dict from arg name to its default value.
        arg_typehint: The typehint for the arg.
        parameters: An updated dict from arg name to its unwrapped primitive type.
          Note that the parameter arg will be added to the dict if it's in the valid
          format and existing entries won't be changed.
        arg_formats: An updated dict from arg name to its format. The format is the
          value of `ArgFormats` enum). Note that the parameter arg will be added to
          the dict if it's in the valid format and existing entries won't be
          changed.
      """
      if arg in arg_defaults:
          if not (
              arg_defaults[arg] is None
              or isinstance(arg_defaults[arg], arg_typehint.type)
          ):
              raise ValueError(
                  f"The default value for optional parameter {arg} on function must be "
                  f"an instance of its declared type {arg_typehint.type} or `None`, "
                  f"got {arg_defaults[arg]}"
              )
      parameters[arg] = arg_typehint.type
      arg_formats[arg] = ArgFormats.PARAMETER
  
imports: import enum
  import inspect
  import sys
  import types
  from typing import Any, Dict, Optional, Type
  from tfx import types
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_executor
  from tfx.dsl.components.base import executor_spec
  from tfx.types import artifact
  from tfx.types import component_spec
  from tfx.types import system_executions
label_desc: Use image node_id 4 for calling a global function with example usage: parse_parameter_arg(arg, arg_defaults, arg_typehint, parameters, arg_formats) without return types