code: def testGetNodeMapInGraph(self):
      g = tf.Graph()
      with g.as_default():
          apple = tf.constant(1.0)
          banana = tf.constant(2.0)
          cherry = tf.constant(3.0)
          aardvark = tf.constant("a")
          badger = tf.constant("b")
          camel = tf.constant("c")
  
          meta_graph_def = meta_graph_pb2.MetaGraphDef()
          meta_graph_def.collection_def[
              "my_collection/%s" % encoding.KEY_SUFFIX
          ].bytes_list.value[:] = map(
              encoding.encode_key, ["alpha", "bravo", "charlie"]
          )
  
          meta_graph_def.collection_def[
              "my_collection/fruits"
          ].any_list.value.extend(
              map(encoding.encode_tensor_node, [apple, banana, cherry])
          )
          meta_graph_def.collection_def[
              "my_collection/animals"
          ].any_list.value.extend(
              map(
                  encoding.encode_tensor_node, [aardvark, badger, camel]
              )
          )
          expected = {
              "alpha": {
                  "fruits": apple,
                  "animals": aardvark,
              },
              "bravo": {
                  "fruits": banana,
                  "animals": badger,
              },
              "charlie": {
                  "fruits": cherry,
                  "animals": camel,
              },
          }
          self.assertDictEqual(
              expected,
              graph_ref.get_node_map_in_graph(
                  meta_graph_def,
                  "my_collection",
                  ["fruits", "animals"],
                  g,
              ),
          )
  
file_path: model-analysis/tensorflow_model_analysis/eval_saved_model/graph_ref_test.py
imports: import tensorflow
  from tensorflow_model_analysis.eval_saved_model import encoding
  from tensorflow_model_analysis.eval_saved_model import graph_ref
  from tensorflow.core.protobuf import meta_graph_pb2
label_desc: Use image node_id 6 for calling the GraphRefTest obj's underlying member method code with example usage: obj.testGetNodeMapInGraph() without return types