class_docstr: Per-node context for pipeline compilation.
class_docstr_tok: ["Per-node","context","for","pipeline","compilation","."]
docstr: Get `NodeInput.inputs` key for the given `BaseChannel`.
  
  Each BaseChannel that is either directly or indirectly used as an input to
  the component is encoded as an InputSpec (1:1 relationship). This method
  gets a corresponding input_key for the channel if it has already been looked
  up, else generates a new input key if the channel has not been used for the
  node yet.
  
  Arguments:
    channel: A BaseChannel that is used either directly or indirectly for the
        input of the node.
  
  Returns:
    A fixed input key for NodeInputs.inputs that corresponds to the channel
    (i.e. the same channel argument would give the same input key).
docstr_tok: ["Get","`","NodeInput.inputs","`","key","for","the","given","`","BaseChannel","`",".","Each","BaseChannel","that","is","either","directly","or","indirectly","used","as","an","input","to","the","component","is","encoded","as","an","InputSpec","(","1:1","relationship",")",".","This","method","gets","a","corresponding","input_key","for","the","channel","if","it","has","already","been","looked","up",",","else","generates","a","new","input","key","if","the","channel","has","not","been","used","for","the","node","yet",".","Arguments",":","channel",":","A","BaseChannel","that","is","used","either","directly","or","indirectly","for","the","input","of","the","node",".","Returns",":","A","fixed","input","key","for","NodeInputs.inputs","that","corresponds","to","the","channel","(","i.e",".","the","same","channel","argument","would","give","the","same","input","key",")","."]
code: def get_input_key(self, channel: channel_types.BaseChannel):
      """Get `NodeInput.inputs` key for the given `BaseChannel`.
  
      Each BaseChannel that is either directly or indirectly used as an input to
      the component is encoded as an InputSpec (1:1 relationship). This method
      gets a corresponding input_key for the channel if it has already been looked
      up, else generates a new input key if the channel has not been used for the
      node yet.
  
      Arguments:
        channel: A BaseChannel that is used either directly or indirectly for the
            input of the node.
  
      Returns:
        A fixed input key for NodeInputs.inputs that corresponds to the channel
        (i.e. the same channel argument would give the same input key).
      """
      if channel not in self._input_key_by_channel:
          try:
              input_key = compiler_utils.implicit_channel_key(channel)
          except ValueError:
              input_key = "_".join(
                  [
                      "_generated",
                      channel.type_name.lower(),
                      str(len(self._input_key_by_channel) + 1),
                  ]
              )
          self._input_key_by_channel[channel] = input_key
      return self._input_key_by_channel[channel]
  
imports: from __future__ import annotations
  import collections
  from typing import Optional, List, Set, Iterable, Dict
  from tfx.dsl.compiler import compiler_utils
  from tfx.dsl.components.base import base_node
  from tfx.dsl.context_managers import dsl_context_registry
  from tfx.dsl.control_flow import for_each_internal
  from tfx.dsl.experimental.conditionals import conditional
  from tfx.dsl.input_resolution import resolver_op
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import channel
  from tfx.types import channel_utils
label_desc: Use image node_id 2 for calling the NodeContext obj's underlying member method code with example usage: obj.get_input_key(channel) and returns: self