code: def count(self, *, page_size=DEFAULT_BATCH_SIZE, **options):
          
          entities = 0
          options = QueryOptions(self).replace(keys_only=True)
          for page in self.paginate(page_size=page_size, **options):
              entities += len(list(page))
          return entities
docs: Counts the number of entities that match this query.
  
          Note:
            Since Datastore doesn't provide a native way to count
            entities by query, this method paginates through all the
            entities' keys and counts them.
  
          Parameters:
            \**options(QueryOptions, optional)
  
          Returns:
            int: The number of entities.