code: def _compile_input_graph(
      pipeline_ctx: compiler_context.PipelineContext,
      tfx_node: base_node.BaseNode,
      channel: resolved_channel.ResolvedChannel,
      result: pipeline_pb2.NodeInputs,
  ) -> str:
      """Compiles ResolvedChannel.output_node as InputGraph and returns its ID."""
      input_graph_id = pipeline_ctx.get_node_context(
          tfx_node
      ).get_input_graph_key(
          channel.output_node, channel.for_each_context
      )
      if input_graph_id in result.input_graphs:
          return input_graph_id
  
      node_to_ids = {}
      input_graph = result.input_graphs[input_graph_id]
  
      def issue_node_id(prefix: str):
          return prefix + str(len(node_to_ids) + 1)
  
      def get_node_id(node: resolver_op.Node):
          if node in node_to_ids:
              return node_to_ids[node]
  
          if isinstance(node, resolver_op.InputNode):
              return compile_input_node(
                  cast(resolver_op.InputNode, node)
              )
          elif isinstance(node, resolver_op.DictNode):
              return compile_dict_node(cast(resolver_op.DictNode, node))
          elif isinstance(node, resolver_op.OpNode):
              return compile_op_node(cast(resolver_op.OpNode, node))
          else:
              raise NotImplementedError(
                  "Expected `node` to be one of InputNode, DictNode, or OpNode "
                  f"but got `{type(node).__name__}` type."
              )
  
      def compile_input_node(input_node: resolver_op.InputNode):
          node_id = issue_node_id(prefix="input_")
          node_to_ids[input_node] = node_id
          input_key = pipeline_ctx.get_node_context(
              tfx_node
          ).get_input_key(input_node.wrapped)
          _compile_input_spec(
              pipeline_ctx=pipeline_ctx,
              tfx_node=tfx_node,
              input_key=input_key,
              channel=input_node.wrapped,
              hidden=True,
              min_count=0,
              result=result,
          )
          input_graph.nodes[node_id].input_node.input_key = input_key
          input_graph.nodes[
              node_id
          ].output_data_type = input_node.output_data_type
          return node_id
  
      def compile_dict_node(dict_node: resolver_op.DictNode):
          node_id = issue_node_id(prefix="dict_")
          node_to_ids[dict_node] = node_id
          input_graph.nodes[node_id].dict_node.node_ids.update(
              {
                  key: get_node_id(child_node)
                  for key, child_node in dict_node.nodes.items()
              }
          )
          input_graph.nodes[
              node_id
          ].output_data_type = (
              pipeline_pb2.InputGraph.DataType.ARTIFACT_MULTIMAP
          )
          return node_id
  
      def compile_op_node(op_node: resolver_op.OpNode):
          node_id = issue_node_id(prefix="op_")
          node_to_ids[op_node] = node_id
          op_node_ir = input_graph.nodes[node_id].op_node
          if issubclass(op_node.op_type, resolver_op.ResolverOp):
              op_node_ir.op_type = op_node.op_type.canonical_name
          else:
              op_node_ir.op_type = name_utils.get_full_name(
                  deprecation_utils.get_first_nondeprecated_class(
                      op_node.op_type
                  )
              )
          for n in op_node.args:
              op_node_ir.args.add().node_id = get_node_id(n)
          for k, v in op_node.kwargs.items():
              data_types_utils.set_parameter_value(
                  op_node_ir.kwargs[k].value, v
              )
          input_graph.nodes[
              node_id
          ].output_data_type = op_node.output_data_type
          return node_id
  
      input_graph.result_node = get_node_id(channel.output_node)
  
      return input_graph_id
  
imports: from typing import Type, cast
  from tfx import types
  from tfx.dsl.compiler import compiler_context
  from tfx.dsl.compiler import compiler_utils
  from tfx.dsl.compiler import constants
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_node
  from tfx.dsl.experimental.conditionals import conditional
  from tfx.dsl.input_resolution import resolver_op
  from tfx.dsl.placeholder import artifact_placeholder
  from tfx.dsl.placeholder import placeholder
  from tfx.orchestration import data_types_utils
  from tfx.proto.orchestration import metadata_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import channel
  from tfx.types import channel_utils
  from tfx.types import resolved_channel
  from tfx.types import value_artifact
  from tfx.utils import deprecation_utils
  from tfx.utils import name_utils
  from tfx.utils import typing_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _compile_input_graph(pipeline_ctx, tfx_node, channel, result) and returns: input_graph_id, input_graph_id, unknown, node_id, node_id, node_id, node_to_ids, compile_input_node, compile_dict_node, compile_op_node