docstr: Check passing a custom comparator to sort a repeated composite field.
docstr_tok: ["Check","passing","a","custom","comparator","to","sort","a","repeated","composite","field","."]
code: def testSortingRepeatedCompositeFieldsCustomComparator(self):
      """Check passing a custom comparator to sort a repeated composite field."""
      message = unittest_pb2.TestAllTypes()
  
      message.repeated_nested_message.add().bb = 1
      message.repeated_nested_message.add().bb = 3
      message.repeated_nested_message.add().bb = 2
      message.repeated_nested_message.add().bb = 6
      message.repeated_nested_message.add().bb = 5
      message.repeated_nested_message.add().bb = 4
      message.repeated_nested_message.sort(lambda x, y: cmp(x.bb, y.bb))
      self.assertEqual(message.repeated_nested_message[0].bb, 1)
      self.assertEqual(message.repeated_nested_message[1].bb, 2)
      self.assertEqual(message.repeated_nested_message[2].bb, 3)
      self.assertEqual(message.repeated_nested_message[3].bb, 4)
      self.assertEqual(message.repeated_nested_message[4].bb, 5)
      self.assertEqual(message.repeated_nested_message[5].bb, 6)
  
imports: import copy
  import math
  import operator
  import pickle
  import unittest
  from google.protobuf import unittest_import_pb2
  from google.protobuf import unittest_pb2
  from google.protobuf.internal import api_implementation
  from google.protobuf.internal import test_util
  from google.protobuf import message
label_desc: Use image node_id 17 for calling the MessageTest obj's underlying member method code with example usage: obj.testSortingRepeatedCompositeFieldsCustomComparator() without return types