class_docstr: ResolverFunction represents a traceable function of resolver operators.
  
  Resolver function returns some form of channel depending on the function
  definition.
  
  It can return a single channel:
  
      trainer = Trainer(
          examples=latest_created(example_gen.outputs['examples']))
  
  or a dictionary of channels:
  
      k_fold_inputs = k_fold(example_gen.outputs['examples'], splits=5)
      trainer = Trainer(
          examples=k_fold_inputs['train'],
      )
      evaluator = Evaluator(
          examples=k_fold_inputs['eval'],
          model=trainer.outputs['model'],
      )
  
  or a ForEach-loopable channels:
  
    with ForEach(
        tfx.dsl.inputs.sequential_rolling_range(
            example_gens.outputs['examples'], n=3)) as train_window:
      trainer = Trainer(
          examples=train_window['examples'])
docstr: Temporarily patches Invocation.
docstr_tok: ["Temporarily","patches","Invocation","."]
code: def given_invocation(
      self,
      f: Callable[..., Any],
      *,
      args: Sequence[Any],
      kwargs: Mapping[str, Any],
  ) -> "ResolverFunction":
      """Temporarily patches Invocation."""
      invocation = resolved_channel.Invocation(
          function=f, args=args, kwargs=kwargs
      )
      if self._invocation is not None:
          raise RuntimeError(
              f"{self.__name__} has already given an invocation."
          )
      self._invocation = invocation
      try:
          yield self
      finally:
          self._invocation = None
  
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 3 for calling the ResolverFunction obj's underlying member method code with example usage: obj.given_invocation(f) without return types