code: def _parse_return_type_kwargs(
      func: types.FunctionType, typehints: Dict[str, Any]
  ) -> Optional[Dict[str, Any]]:
      """Parse function return type which should be TypedDict or OutputDict."""
      return_annotation = typehints.get("return")
      if return_annotation is None:
          return None
      elif _is_typeddict(return_annotation):
          return typing.get_type_hints(return_annotation)
      elif isinstance(
          return_annotation, annotations.OutputDict
      ):  # For backward compatibility.
          return return_annotation.kwargs
      else:
          raise ValueError(
              f"Return type annotation of @component {func.__name__} should be"
              " TypedDict or None."
          )
  
file_path: tfx/tfx/dsl/component/experimental/function_parser.py
imports: import inspect
  import sys
  import types
  import typing
  from typing import Any, Dict, NamedTuple, Optional, Type, Union, get_args, get_origin
  from tfx.dsl.component.experimental import annotations
  from tfx.dsl.component.experimental import json_compat
  from tfx.dsl.component.experimental import utils
  from tfx.types import artifact
  from tfx.types import standard_artifacts
  import typing_extensions
label_desc: Use image node_id 2 for calling a global function with example usage: _parse_return_type_kwargs(func, typehints) and returns: None, typing, return_annotation