def __iter__(self):
    """Create a generator for keys in the range.

    Iterating through entries moves query range past the consumed entries.

    Yields:
      next entry.
    """
    while True:
      raw_entity_kind = util.get_short_name(self._entity_kind)
      query = self._key_range.make_ascending_datastore_query(
          raw_entity_kind, keys_only=True)
      results = query.Get(limit=self._batch_size)

      if not results:
        break

      for key in results:
        self._key_range.advance(key)
        yield key
Create a generator for keys in the range.

    Iterating through entries moves query range past the consumed entries.

    Yields:
      next entry.
    
mapreduce/input_readers.py