class_docstr: Definition for TFX Resolver.
  
  Resolver is a special TFX node which handles special artifact resolution
  logics that will be used as inputs for downstream nodes.
  
  To use Resolver, pass the followings to the Resolver constructor:
  
  * Name of the Resolver instance
  * A subclass of ResolverStrategy
  * Configs that will be used to construct an instance of ResolverStrategy
  * Channels to resolve with their tag, in the form of kwargs
  
  Here is an example:
  
  ```
  example_gen = ImportExampleGen(...)
  examples_resolver = Resolver(
        strategy_class=tfx.dsl.experimental.SpanRangeStrategy,
        config={'range_config': range_config},
        examples=Channel(type=Examples, producer_component_id=example_gen.id)
        ).with_id('Resolver.span_resolver')
  trainer = Trainer(
      examples=examples_resolver.outputs['examples'],
      ...)
  ```
  
  You can find experimental `ResolverStrategy` classes under
  `tfx.v1.dsl.experimental` module, including `LatestArtifactStrategy`,
  `LatestBlessedModelStrategy`, `SpanRangeStrategy`, etc.
docstr: Init function for Resolver.
  
  Args:
    strategy_class: Optional `ResolverStrategy` which contains the artifact
        resolution logic.
    config: Optional dict of key to Jsonable type for constructing
        resolver_strategy.
    **channels: Input channels to the Resolver node as keyword arguments.
docstr_tok: ["Init","function","for","Resolver",".","Args",":","strategy_class",":","Optional","`","ResolverStrategy","`","which","contains","the","artifact","resolution","logic",".","config",":","Optional","dict","of","key","to","Jsonable","type","for","constructing","resolver_strategy",".","*","*","channels",":","Input","channels","to","the","Resolver","node","as","keyword","arguments","."]
code: def __init__(
      self,
      strategy_class: Optional[Type[ResolverStrategy]] = None,
      config: Optional[Dict[str, json_utils.JsonableType]] = None,
      **channels: types.BaseChannel,
  ):
      """Init function for Resolver.
  
      Args:
        strategy_class: Optional `ResolverStrategy` which contains the artifact
            resolution logic.
        config: Optional dict of key to Jsonable type for constructing
            resolver_strategy.
        **channels: Input channels to the Resolver node as keyword arguments.
      """
      if strategy_class is not None and not issubclass(
          strategy_class, ResolverStrategy
      ):
          raise TypeError(
              "strategy_class should be ResolverStrategy, but got "
              f"{strategy_class} instead."
          )
      if strategy_class is None and config is not None:
          raise ValueError(
              "Cannot use config parameter without strategy_class."
          )
      for input_key, channel in channels.items():
          if not isinstance(channel, channel_types.BaseChannel):
              raise ValueError(
                  f"Resolver got non-BaseChannel argument {input_key}."
              )
      self._strategy_class = strategy_class
      self._config = config or {}
      # An observed inputs from DSL as if Resolver node takes an inputs.
      # TODO(b/246907396): Remove raw_inputs usage.
      self._raw_inputs = dict(channels)
      if strategy_class is not None:
          output_node = resolver_op.OpNode(
              op_type=strategy_class,
              output_data_type=resolver_op.DataType.ARTIFACT_MULTIMAP,
              args=[
                  resolver_op.DictNode(
                      {
                          input_key: resolver_op.InputNode(channel)
                          for input_key, channel in channels.items()
                      }
                  )
              ],
              kwargs=self._config,
          )
          self._input_dict = {
              k: resolved_channel.ResolvedChannel(
                  c.type, output_node, k
              )
              for k, c in channels.items()
          }
      else:
          self._input_dict = channels
      self._output_dict = {
          input_key: types.OutputChannel(channel.type, self, input_key)
          for input_key, channel in channels.items()
      }
      super().__init__(driver_class=_ResolverDriver)
  
imports: import abc
  from typing import Any, Dict, List, Optional, Type, Mapping
  from tfx import types
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.components.base import base_node
  from tfx.dsl.input_resolution import resolver_op
  from tfx.orchestration import data_types
  from tfx.orchestration import metadata
  from tfx.types import channel
  from tfx.types import channel_utils
  from tfx.types import resolved_channel
  from tfx.utils import doc_controls
  from tfx.utils import json_utils
  from tfx.utils import typing_utils
  import ml_metadata
label_desc: Use image node_id 1 to create a new Resolver object from inherited base classes: base_node with example: obj = Resolver(strategy_class, config)