code: def filter(self, *args):
      '''Adds a Filter to this query.
  
      Args:
        see :py:class:`Filter <datastore.query.Filter>` constructor
  
      Returns self for JS-like method chaining::
  
        query.filter('age', '>', 18).filter('sex', '=', 'Female')
  
      '''
      if len(args) == 1 and isinstance(args[0], Filter):
        filter = args[0]
      else:
        filter = Filter(*args)
  
      # ensure filter gets attr values the same way the rest of the query does.
      filter.object_getattr = self.object_getattr
      self.filters.append(filter)
      return self filter(self, *args):
      '''Adds a Filter to this query.
  
      Args:
        see :py:class:`Filter <datastore.query.Filter>` constructor
  
      Returns self for JS-like method chaining::
  
        query.filter('age', '>', 18).filter('sex', '=', 'Female')
  
      '''
      if len(args) == 1 and isinstance(args[0], Filter):
        filter = args[0]
      else:
        filter = Filter(*args)
  
      # ensure filter gets attr values the same way the rest of the query does.
      filter.object_getattr = self.object_getattr
      self.filters.append(filter)
      return self
docs: Adds a Filter to this query.
  
      Args:
        see :py:class:`Filter <datastore.query.Filter>` constructor
  
      Returns self for JS-like method chaining::
  
        query.filter('age', '>', 18).filter('sex', '=', 'Female')