def _assertEqualsAndSerialize(self, expected, kranges):
    results = []
    while True:
      try:
        results.append(kranges.next())
        kranges = kranges.__class__.from_json(kranges.to_json())
      except __HOLE__:
        break
    self.assertRaises(StopIteration, kranges.next)
    expected.sort()
    results.sort()
    self.assertEquals(expected, results)
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/test/mapreduce/key_ranges_test.py/KeyRangesTest._assertEqualsAndSerialize