code: def resolver_function(
      f: Optional[Callable[..., resolver_op.OpNode]] = None,
      *,
      output_type: Optional[_TypeHint] = None,
      unwrap_dict_key: Optional[Union[str, Sequence[str]]] = None,
  ):
      """Decorator for the resolver function.
  
      Args:
        f: Python function to decorate. See the usage at canned_resolver_function.py
        output_type: Optional static output type hint.
        unwrap_dict_key: If present, it will add loopable transform that unwraps
          dictionary key(s) so that `ForEach` captured value is a single channel, or
          a tuple of channels. This is only valid if the resolver function return
          value is ARTIFACT_MULTIMAP_LIST type.
  
      Returns:
        A ResolverFunction, or a decorator to create ResolverFunction.
      """
      if f is not None:
          return ResolverFunction(f)
  
      loopable_transform = None
      if unwrap_dict_key:
          if isinstance(unwrap_dict_key, str):
              key = cast(str, unwrap_dict_key)
              loopable_transform = lambda d: d[key]
          elif typing_utils.is_compatible(
              unwrap_dict_key, Sequence[str]
          ):
              keys = cast(Sequence[str], unwrap_dict_key)
              loopable_transform = lambda d: tuple(
                  d[key] for key in keys
              )
          else:
              raise ValueError(
                  "Invalid unwrap_dict_key: Expected str or Sequence[str] but got "
                  f"{unwrap_dict_key}"
              )
  
      def decorator(f):
          return ResolverFunction(
              f,
              output_type=output_type,
              loopable_transform=loopable_transform,
          )
  
      return decorator
  
imports: import contextlib
  import inspect
  from typing import Callable, Type, Union, Mapping, Any, Optional, Sequence, cast, overload
  from tfx.dsl.control_flow import for_each_internal
  from tfx.dsl.input_resolution import resolver_op
  from tfx.types import artifact
  from tfx.types import channel
  from tfx.types import resolved_channel
  from tfx.utils import doc_controls
  from tfx.utils import typing_utils
label_desc: Use image node_id 4 for calling a global function with example usage: resolver_function(f) and returns: decorator, ResolverFunction, ResolverFunction