def testIndexedReads(self):
    with aff4.FACTORY.Create("aff4:/sequential_collection/testIndexedReads",
                             "TestIndexedSequentialCollection",
                             token=self.token) as collection:
      data_size = 4 * 1024
      for i in range(data_size):
        collection.Add(rdfvalue.RDFInteger(i))
      with test_lib.FakeTime(rdfvalue.RDFDatetime().Now() + rdfvalue.Duration(
          "10m")):
        for i in range(data_size - 1, data_size - 20, -1):
          self.assertEqual(collection[i], i)
        self.assertEqual(collection[1023], 1023)
        self.assertEqual(collection[1024], 1024)
        self.assertEqual(collection[1025], 1025)
        for i in range(data_size - 1020, data_size - 1040, -1):
          self.assertEqual(collection[i], i)
dataset/ETHPy150Open google/grr/grr/lib/aff4_objects/sequential_collection_test.py/IndexedSequentialCollectionTest.testIndexedReads/original