code: def testTopologicallySortedInputKeys(self):
      node_inputs = self.parse_node_inputs(
          """
        inputs {
          key: "input_1"
          value {
            channels {
              artifact_query {
                type {
                  name: "Examples"
                }
              }
            }
          }
        }
        inputs {
          key: "input_2"
          value {
            input_graph_ref {
              graph_id: "graph_1"
            }
          }
        }
        input_graphs {
          key: "graph_1"
          value {
            nodes {
              key: "node_1"
              value {
                input_node {
                  input_key: "input_1"
                }
              }
            }
            result_node: "node_1"
          }
        }
      """
      )
  
      # input_2 uses graph_1
      # graph_1 depends on input_1
      # therefore input_2 depends on input_1.
      result = node_inputs_resolver._topologically_sorted_input_keys(
          node_inputs.inputs, node_inputs.input_graphs
      )
      self.assertEqual(result, ["input_1", "input_2"])
  
imports: from typing import Set
  from unittest import mock
  import tensorflow
  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 node_inputs_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
  import tfx.types
  from tfx.types import channel_utils
  from tfx.utils import test_case_utils
  from google.protobuf import text_format
label_desc: Use image node_id 3 for calling the ProtectedFunctionTest obj's underlying member method code with example usage: obj.testTopologicallySortedInputKeys() without return types