code: def get_input_nodes(node: Node) -> Set[InputNode]:
      """Get `InputNode`s that are used to produce the given `output_node`."""
      if isinstance(node, InputNode):
          return {node}
      elif isinstance(node, OpNode):
          result = set()
          for arg_node in node.args:
              result.update(get_input_nodes(arg_node))
          return result
      elif isinstance(node, DictNode):
          result = set()
          for wrapped in node.nodes.values():
              result.update(get_input_nodes(wrapped))
          return result
      else:
          raise AssertionError(
              "Should not reach here; "
              f"type={type(node).__name__}, value={node}"
          )
  
imports: from __future__ import annotations
  import abc
  from typing import Any, Generic, Literal, Mapping, Optional, Sequence, Set, Type, TypeVar, Union
  import attr
  from tfx import types
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import json_utils
  from tfx.utils import typing_utils
  import ml_metadata
label_desc: Use image node_id 1 for calling a global function with example usage: get_input_nodes(node) and returns: unknown, result, result