code: def testOptionalReturnValues(self):
      def func_a() -> (
          OutputDict(
              precision=float,
              recall=float,
              message=str,
              serialized_value=bytes,
              optional_label=Optional[str],
              optional_metric=Optional[float],
              optional_json=Optional[Dict[str, List[bool]]],
          )
      ):
          return {
              "precision": 0.9,
              "recall": 0.8,
              "message": "foo",
              "serialized_value": b"bar",
              "optional_label": None,
              "optional_metric": 1.0,
              "optional_json": {"foo": 1},
          }
  
      (
          inputs,
          outputs,
          parameters,
          arg_formats,
          arg_defaults,
          returned_values,
          json_typehints,
          return_json_typehints,
      ) = parse_typehint_component_function(func_a)
      self.assertDictEqual(inputs, {})
      self.assertDictEqual(
          outputs,
          {
              "precision": standard_artifacts.Float,
              "recall": standard_artifacts.Float,
              "message": standard_artifacts.String,
              "serialized_value": standard_artifacts.Bytes,
              "optional_label": standard_artifacts.String,
              "optional_metric": standard_artifacts.Float,
              "optional_json": standard_artifacts.JsonValue,
          },
      )
      self.assertDictEqual(parameters, {})
      self.assertDictEqual(arg_formats, {})
      self.assertDictEqual(arg_defaults, {})
      self.assertEqual(
          returned_values,
          {
              "precision": False,
              "recall": False,
              "message": False,
              "serialized_value": False,
              "optional_label": True,
              "optional_metric": True,
              "optional_json": True,
          },
      )
      self.assertDictEqual(json_typehints, {})
      self.assertDictEqual(
          return_json_typehints,
          {"optional_json": Optional[Dict[str, List[bool]]]},
      )
  
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 5 for calling the FunctionParserTest obj's underlying member method code with example usage: obj.testOptionalReturnValues() and returns: dict