code: def implicit_channel_key(channel: types.BaseChannel):
      """Key of a channel to the node that consumes the channel as input."""
      if isinstance(channel, channel_types.PipelineInputChannel):
          channel = cast(channel_types.PipelineInputChannel, channel)
          return f"_{channel.pipeline.id}.{channel.output_key}"
      elif isinstance(channel, types.Channel):
          if channel.producer_component_id and channel.output_key:
              return f"_{channel.producer_component_id}.{channel.output_key}"
          raise ValueError(
              "Cannot create implicit input key for Channel that has no "
              "producer_component_id and output_key."
          )
      elif isinstance(channel, channel_types.ExternalPipelineChannel):
          if (
              channel.owner
              and channel.pipeline_name
              and channel.producer_component_id
              and channel.output_key
          ):
              implicit_key = f"_{channel.producer_component_id}.{channel.output_key}.{channel.owner}.{channel.pipeline_name}"
              if channel.pipeline_run_id:
                  return implicit_key + "." + channel.pipeline_run_id
              else:
                  return implicit_key
          raise ValueError(
              "Cannot create implicit input key for Channel that has no"
              "ower, pipeline_name, producer_component_id and output_key."
          )
      else:
          raise ValueError(
              "Unsupported channel type for implicit channel key."
          )
  
imports: from typing import cast, List, Optional, Sequence, Tuple, Type, Union, Dict, Any, Set
  from tfx import types
  from tfx.dsl.compiler import constants
  from tfx.dsl.components.base import base_node
  from tfx.dsl.components.common import importer
  from tfx.dsl.components.common import resolver
  from tfx.dsl.context_managers import dsl_context_registry
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import pipeline
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import channel
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 18 for calling a global function with example usage: implicit_channel_key(channel) and returns: str, channel, str, channel, str, channel, str, channel, unknown, implicit_key