code: def testDescriptorToFieldMask(self):
      mask = field_mask_pb2.FieldMask()
      msg_descriptor = unittest_pb2.TestAllTypes.DESCRIPTOR
      mask.AllFieldsFromDescriptor(msg_descriptor)
      self.assertEqual(75, len(mask.paths))
      self.assertTrue(mask.IsValidForDescriptor(msg_descriptor))
      for field in msg_descriptor.fields:
          self.assertTrue(field.name in mask.paths)
      mask.paths.append("optional_nested_message.bb")
      self.assertTrue(mask.IsValidForDescriptor(msg_descriptor))
      mask.paths.append("repeated_nested_message.bb")
      self.assertFalse(mask.IsValidForDescriptor(msg_descriptor))
  
imports: from datetime import datetime
  from google.protobuf import any_pb2
  from google.protobuf import duration_pb2
  from google.protobuf import field_mask_pb2
  from google.protobuf import struct_pb2
  from google.protobuf import timestamp_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf.internal import any_test_pb2
  from google.protobuf.internal import test_util
  from google.protobuf.internal import well_known_types
  from google.protobuf import descriptor
  from google.protobuf import text_format
label_desc: Use image node_id 2 for calling the FieldMaskTest obj's underlying member method code with example usage: obj.testDescriptorToFieldMask() without return types