code: def test_get_field_tag(self):
      proto = test_message_pb2.ManyFields()
  
      # proto.field_one.repeated_field[15].map_field_uint32[10]
      ret = util.get_field_tag(
          proto,
          ["field_one", "repeated_field", 15, "map_field_uint32", 10],
      )
      self.assertLen(ret, 5)
      self.assertEqual(1, ret[0].field)
      self.assertEqual(2, ret[1].field)
      self.assertEqual(15, ret[2].index)
      self.assertEqual(5, ret[3].field)
      self.assertEqual(10, ret[4].map_key.ui32)
      self.assertFalse(ret[4].map_key.HasField("i32"))
  
      # proto.nested_map_bool[False].map_field_int64
      ret = util.get_field_tag(
          proto, ["nested_map_bool", False, "map_field_int64"]
      )
  
      self.assertLen(ret, 3)
      self.assertEqual(7, ret[0].field)
      self.assertEqual(False, ret[1].map_key.boolean)
      self.assertEqual(6, ret[2].field)
  
      # proto.repeated_field[55].nested_map_bool[True].string_field
      ret = util.get_field_tag(proto, [2, 55, 7, True, 3])
      self.assertLen(ret, 5)
      self.assertEqual(2, ret[0].field)
      self.assertEqual(55, ret[1].index)
      self.assertEqual(7, ret[2].field)
      self.assertEqual(True, ret[3].map_key.boolean)
      self.assertEqual(3, ret[4].field)
  
file_path: tensorflow/tensorflow/tools/proto_splitter/util_test.py
imports: from typing import Iterable
  from tensorflow.python.platform import test
  from tensorflow.tools.proto_splitter import util
  from tensorflow.tools.proto_splitter.testdata import test_message_pb2
label_desc: Use image node_id 2 for calling the UtilTest obj's underlying member method code with example usage: obj.test_get_field_tag() without return types