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: Try converting python value to resolver_op.Node.
docstr_tok: ["Try","converting","python","value","to","resolver_op.Node","."]
code: def _try_convert_to_node(value: Any) -> Any:
      """Try converting python value to resolver_op.Node."""
      if isinstance(value, channel.BaseChannel):
          return resolver_op.InputNode(value)
      if typing_utils.is_compatible(
          value, Mapping[str, channel.BaseChannel]
      ):
          return resolver_op.DictNode(
              {
                  input_key: resolver_op.InputNode(input_channel)
                  for input_key, input_channel in value.items()
              }
          )
      return value
  
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 the ResolverFunction obj's underlying member method code with example usage: obj._try_convert_to_node(value) and returns: value, resolver_op, resolver_op