code: def testOptionalArguments(self):
      # Various optional argument schemes.
      def func_a(
          a: float,
          b: int,
          c: Parameter[str],
          d: int = 123,
          e: Optional[int] = 345,
          f: str = "abc",
          g: bytes = b"xyz",
          h: bool = False,
          i: Parameter[str] = "default",
          j: Parameter[int] = 999,
          k: BeamComponentParameter[beam.Pipeline] = None,
          examples: InputArtifact[standard_artifacts.Examples] = None,
          optional_json: Optional[
              Union[List[Dict[str, int]], Dict[str, bool]]
          ] = None,
      ):
          del a, b, c, d, e, f, g, h, i, j, k, examples, optional_json
  
      (
          inputs,
          outputs,
          parameters,
          arg_formats,
          arg_defaults,
          returned_values,
          json_typehints,
          return_json_typehints,
      ) = parse_typehint_component_function(func_a)
      self.assertDictEqual(
          inputs,
          {
              "a": standard_artifacts.Float,
              "b": standard_artifacts.Integer,
              # 'c' is missing here as it is a parameter.
              "d": standard_artifacts.Integer,
              "e": standard_artifacts.Integer,
              "f": standard_artifacts.String,
              "g": standard_artifacts.Bytes,
              "h": standard_artifacts.Boolean,
              # 'i' is missing here as it is a parameter.
              # 'j' is missing here as it is a parameter.
              "examples": standard_artifacts.Examples,
              "optional_json": standard_artifacts.JsonValue,
          },
      )
      self.assertDictEqual(outputs, {})
      self.assertDictEqual(
          parameters,
          {
              "c": str,
              "i": str,
              "j": int,
              "k": beam.Pipeline,
          },
      )
      self.assertDictEqual(
          arg_formats,
          {
              "a": ArgFormats.ARTIFACT_VALUE,
              "b": ArgFormats.ARTIFACT_VALUE,
              "c": ArgFormats.PARAMETER,
              "d": ArgFormats.ARTIFACT_VALUE,
              "e": ArgFormats.ARTIFACT_VALUE,
              "f": ArgFormats.ARTIFACT_VALUE,
              "g": ArgFormats.ARTIFACT_VALUE,
              "h": ArgFormats.ARTIFACT_VALUE,
              "i": ArgFormats.PARAMETER,
              "j": ArgFormats.PARAMETER,
              "k": ArgFormats.BEAM_PARAMETER,
              "examples": ArgFormats.INPUT_ARTIFACT,
              "optional_json": ArgFormats.ARTIFACT_VALUE,
          },
      )
      self.assertDictEqual(
          arg_defaults,
          {
              "d": 123,
              "e": 345,
              "f": "abc",
              "g": b"xyz",
              "h": False,
              "i": "default",
              "j": 999,
              "k": None,
              "examples": None,
              "optional_json": None,
          },
      )
      self.assertEqual(returned_values, {})
      self.assertDictEqual(
          json_typehints,
          {
              "optional_json": Optional[
                  Union[List[Dict[str, int]], Dict[str, bool]]
              ]
          },
      )
      self.assertDictEqual(return_json_typehints, {})
  
imports: from typing import Dict, List, Optional, TypedDict, Union
  import apache_beam
  import tensorflow
  from tfx.dsl.component.experimental.annotations import BeamComponentParameter
  from tfx.dsl.component.experimental.annotations import InputArtifact
  from tfx.dsl.component.experimental.annotations import OutputArtifact
  from tfx.dsl.component.experimental.annotations import OutputDict
  from tfx.dsl.component.experimental.annotations import Parameter
  from tfx.dsl.component.experimental.function_parser import parse_typehint_component_function
  from tfx.dsl.component.experimental.utils import ArgFormats
  from tfx.types import standard_artifacts
label_desc: Use image node_id 4 for calling the FunctionParserTest obj's underlying member method code with example usage: obj.testOptionalArguments() without return types