code: def filter(self):
          
          argmap = {
              filter.label or label: filter.field
              for label, filter in self.filters.items()
          }
          args = self.opts.parser.parse(argmap)
          query = self.query if self.query is not None else self.opts.query
          for label, filter in self.filters.items():
              value = args.get(filter.label or label)
              if value is not None:
                  query = filter.filter(query, self.opts.model, label, value)
          return query
docs: Generate a filtered query from request parameters.
  
          :returns: Filtered SQLALchemy query