def Count(self, limit=1000, **kwargs):
    original_offset = kwargs.pop('offset', 0)
    if limit is None:
      offset = _MAX_INT_32
    else:
      offset = min(limit + original_offset, _MAX_INT_32)
    kwargs['limit'] = 0
    kwargs['offset'] = offset
    config = _GetConfigFromKwargs(kwargs, convert_rpc=True,
                                  config_class=datastore_query.QueryOptions)

    batch = self.GetBatcher(config=config).next()
    self.__index_list_source = (
        lambda: [index for index, state in batch.index_list])
    self.__cursor_source = lambda: batch.cursor(0)
    self.__compiled_query_source = lambda: batch._compiled_query
    return max(0, batch.skipped_results - original_offset)
Lookup the PTR records associated with C{name}.
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/api/datastore.py/Query.Count--crossover with--dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/internet/interfaces.py/IResolver.lookupPointer