code: def test_get_field_and_desc(self):
      proto = test_message_pb2.ManyFields(
          field_one=test_message_pb2.ManyFields(
              repeated_field=[
                  test_message_pb2.ManyFields(),
                  test_message_pb2.ManyFields(
                      string_field="inner_inner_string",
                      map_field_uint32={
                          324: "map_value_324",
                          543: "map_value_543",
                      },
                  ),
              ]
          ),
          map_field_int64={
              -1345: "map_value_-1345",
          },
          nested_map_bool={
              True: test_message_pb2.ManyFields(
                  string_field="string_true"
              ),
              False: test_message_pb2.ManyFields(
                  string_field="string_false"
              ),
          },
      )
  
      field, field_desc = util.get_field(proto, [])
      self.assertIs(proto, field)
      self.assertIsNone(field_desc)
  
      field, field_desc = util.get_field(
          proto, ["field_one", "repeated_field"]
      )
      self.assertIsInstance(field, Iterable)
      self.assertLen(field, 2)
      self.assertEqual("repeated_field", field_desc.name)
      self.assertEqual(2, field_desc.number)
      self.assertProtoEquals(proto.field_one.repeated_field, field)
  
      field, field_desc = util.get_field(proto, ["field_one", 2, 1])
      self.assertIsInstance(field, test_message_pb2.ManyFields)
      self.assertEqual("repeated_field", field_desc.name)
      self.assertEqual(2, field_desc.number)
      self.assertProtoEquals(proto.field_one.repeated_field[1], field)
  
      field, _ = util.get_field(
          proto, ["field_one", 2, 1, "string_field"]
      )
      self.assertEqual("inner_inner_string", field)
  
      field, _ = util.get_field(
          proto, ["field_one", 2, 1, "map_field_uint32", 324]
      )
      self.assertEqual("map_value_324", field)
  
      field, _ = util.get_field(
          proto, ["nested_map_bool", False, "string_field"]
      )
      self.assertEqual("string_false", field)
  
      field, _ = util.get_field(
          proto, ["nested_map_bool", True, "string_field"]
      )
      self.assertEqual("string_true", 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 4 for calling the UtilTest obj's underlying member method code with example usage: obj.test_get_field_and_desc() without return types