Return filter form.
357349
def get_form(self, request, rel, admin_site):
        """"""
        return DynamicRawIDFilterForm(
            admin_site=admin_site,
            rel=rel,
            field_name=self.field_path,
            data=self.used_parameters,
        )
710699
def Filter(self, match=None, **_):
    """"""
    arg = self.stack.pop(-1)

    # Filters can be specified as a comma separated list.
    for filter_name in match.group(1).split(","):
      filter_object = ConfigFilter.classes_by_name.get(filter_name)
      if filter_object is None:
        raise FilterError("Unknown filter function %r" % filter_name)

      if not filter_object.sensitive_arg:
        logging.debug("Applying filter %s for %s.", filter_name, arg)
      arg = filter_object().Filter(arg)
      precondition.AssertType(arg, Text)

    self.stack[-1] += arg
71438
def filters(self):
        """"""
        if self._filters is None:
            self._filters, self._attributes = self._fetch_configuration()
        return self._filters
474933
async def filter(self, request):
        """"""
        collection = self.collection
        self.filter_form.process(request.query)
        data = self.filter_form.data
        self.filter_form.active = any(o and o is not DEFAULT for o in data.values())
        for flt in self.columns_filters:
            try:
                collection = flt.apply(collection, data)
            # Invalid filter value
            except ValueError:
                continue
        return collection
414434
def filter(self, data, collection, **kwargs):
        """"""
        if not data or self.filters is None:
            return None, collection

        filters = {}
        for f in self.filters:
            if f.name not in data:
                continue
            ops, collection = f.filter(collection, data, **kwargs)
            filters[f.name] = ops

        return filters, collection
557494
def filter(cls, filters, iterable):
    ''''''
    if isinstance(filters, Filter):
      filters = [filters]

    for filter in filters:
      iterable = filter.generator(iterable)

    return iterable
854093
protected function getFiltersType()
    {
        // var_dump($this->get('request')->query->all());exit;
        $form = $this->get('form.factory')->createNamed('filters', 'form', null, array(
            'action'          => $this->generateUrl($this->getRoutePrefix(), array(
                'sort'  => $this->get('request')->get('sort'),
                'order' => $this->get('request')->get('order'),
            )),
            'method'          => 'GET',
            'csrf_protection' => false,
            'attr'            => array(
                'class'    => 'form-inline',
            ),
        ));

        return $form;
    }
571867
def parse_form(self, req, name, field):
        """"""
        return core.get_value(req.forms, name, field)
703267
def _fill_form_exclude_cols(self, exclude_cols, form):
        
        for filter_key in exclude_cols:
            filter_value = self._filters.get_filter_value(filter_key)
            rel_obj = self.datamodel.get_related_obj(filter_key, filter_value)
            if hasattr(form, filter_key):
                field = getattr(form, filter_key)
                field.data = rel_obj
1373304
def filter(self, filter):
        """"""
        if hasattr(filter, '__call__'):
            return [entry for entry in self.entries if filter(entry)]
        else:
            pattern = re.compile(filter, re.IGNORECASE)
            return [entry for entry in self.entries if pattern.match(entry)]
441756
def get(cls, parent, url_id):
        """"""
        return cls.query.filter_by(parent=parent, url_id=url_id).one_or_none()
442185
def _product_filter(products) -> str:
    """"""
    _filter = 0
    for product in {PRODUCTS[p] for p in products}:
        _filter += product
    return format(_filter, "b")[::-1]
56539
def filter(self):
        
        if isinstance(self._filter, str):
            return self._decode_query(self._filter)
        return self._filter
1029413
def filter(self, table, mappings, filter_string):
        """"""
        q = filter_string.lower()
        return [mapping for mapping in mappings
                if q in mapping.ud.lower()]
1229120
def during(self, year, month):
		""""""
		return self.filter(created__year=year, created__month=month)
887589
def get_filters(self):
        
        if self._filters:
            filters_list = self._filters
            if isinstance(filters_list[-1], Enum):
                filters_list = filters_list[:-1]
            return ' '.join(
                [fs.value if isinstance(fs, Enum) else fs[1] for fs in
                 filters_list]).strip()
        else:
            return None
699972
def query(self, force=False):
        """"""
        if not self.is_valid():
            raise forms.ValidationError(self.errors)
        if force:
            self._is_selected = False
        if not self._is_selected:
            if self.queryset is None:
                raise TypeError('Must be QuerySet not %s' %
                                type(self.queryset))
            self.select()
            self._is_selected = True
        return self.queryset