code: def _get_dependencies(
      input_specs: Mapping[str, pipeline_pb2.InputSpec],
      input_graphs: Mapping[str, pipeline_pb2.InputGraph],
  ) -> Dict[str, List[str]]:
      """Get dependencies of input_specs."""
      result = collections.defaultdict(list)
      for input_key, input_spec in input_specs.items():
          if input_spec.input_graph_ref.graph_id:
              graph_id = input_spec.input_graph_ref.graph_id
              # Should check graph_id existence, otherwise input_graphs[graph_id]
              # silently creates and returns an empty InputGraph (proto stub behavior).
              if graph_id not in input_graphs:
                  raise exceptions.FailedPreconditionError(
                      f"NodeInputs.inputs[{input_key}] has invalid input_graph_ref; "
                      f"graph_id {graph_id} does not exist. "
                      f"Available: {list(input_graphs)}"
                  )
              input_graph = input_graphs[
                  input_spec.input_graph_ref.graph_id
              ]
              for node_def in input_graph.nodes.values():
                  if node_def.WhichOneof("kind") == "input_node":
                      result[input_key].append(
                          node_def.input_node.input_key
                      )
          elif input_spec.mixed_inputs.input_keys:
              result[input_key].extend(
                  input_spec.mixed_inputs.input_keys
              )
      return result
  
imports: import collections
  from typing import Dict, Iterable, List, Mapping, Sequence, Tuple, TypeVar
  from tfx import types
  from tfx.dsl.compiler import placeholder_utils
  from tfx.orchestration import metadata
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable import data_types
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.orchestration.portable.input_resolution import input_graph_resolver
  from tfx.orchestration.portable.input_resolution import partition_utils
  from tfx.orchestration.portable.input_resolution import channel_resolver
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact_utils
  from tfx.utils import topsort
  from tfx.utils import typing_utils
  from tfx.utils import governance_utils
label_desc: Use image node_id 3 for calling a global function with example usage: _get_dependencies(input_specs, input_graphs) and returns: result