class_docstr: Tests for the properties of descriptors in generated code.
class_docstr_tok: ["Tests","for","the","properties","of","descriptors","in","generated","code","."]
code: def CheckDescriptorSequence(self, sequence):
      # Verifies that a property like 'messageDescriptor.fields' has all the
      # properties of an immutable abc.Sequence.
      self.assertGreater(len(sequence), 0)  # Sized
      self.assertEqual(len(sequence), len(list(sequence)))  # Iterable
      item = sequence[0]
      self.assertEqual(item, sequence[0])
      self.assertIn(item, sequence)  # Container
      self.assertEqual(sequence.index(item), 0)
      self.assertEqual(sequence.count(item), 1)
      reversed_iterator = reversed(sequence)
      self.assertEqual(list(reversed_iterator), list(sequence)[::-1])
      self.assertRaises(StopIteration, next, reversed_iterator)
  
imports: import sys
  from google.protobuf import unittest_custom_options_pb2
  from google.protobuf import unittest_import_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf import descriptor_pb2
  from google.protobuf.internal import api_implementation
  from google.protobuf.internal import test_util
  from google.protobuf import descriptor
  from google.protobuf import descriptor_pool
  from google.protobuf import symbol_database
  from google.protobuf import text_format
label_desc: Use image node_id 3 for calling the GeneratedDescriptorTest obj's underlying member method code with example usage: obj.CheckDescriptorSequence(sequence) without return types