Register filter and also can batch add
516205
function registerFilter(name, filter, options, mergeConfig) {
  var params = name;

  if (!isObject(name)) {
    params = {};
    params[name] = {
      filter: filter,
      options: options
    };
  }

  each(params, function (v, name) {
    if (v) {
      var _filter = v.filter,
          _options = v.options;

      if (_options) {
        if (_options.isOperator) {
          var createRegexOperators = nj.createRegexOperators;

          if (createRegexOperators) {
            createRegexOperators(name);
          }
        }

        var alias = _options.alias;

        if (alias) {
          var createFilterAlias = nj.createFilterAlias;

          if (createFilterAlias) {
            createFilterAlias(name, alias);
            name = alias;
          }
        }
      }

      if (_filter) {
        filters[name] = _filter;
      } else if (!mergeConfig) {
        filters[name] = v;
      }

      if (mergeConfig) {
        if (!filterConfig[name]) {
          filterConfig[name] = _config$1();
        }

        assign(filterConfig[name], _options);
      } else {
        filterConfig[name] = _config$1(_options);
      }
    }
  }, false);
}
40781
function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1)
	{
		if( is_callable($function_to_add) )
		{
			add_filter($tag, $function_to_add, $priority, $accepted_args);
		}
	}
758444
def apply_filter(self):
    ''''''
    self._ensure_modification_is_safe()

    if len(self.query.filters) > 0:
      self._iterable = Filter.filter(self.query.filters, self._iterable)
1228084
def setup_filter(self, root_path, path_list):
        """"""
        self.root_path = osp.normpath(to_text_string(root_path))
        self.path_list = [osp.normpath(to_text_string(p)) for p in path_list]
        self.invalidateFilter()
337606
def enable(self):
        """"""
        with self._lock:
            if self.filter is None:
                self.filter = self._filter_type(self)
917860
private function applyDataTableFilters()
    {
        $filters = $this->request->getFilters();

        foreach ($filters as $fieldName => $filterValue) {
            if (empty($filterValue)) {
                continue;
            }

            if (is_array($filterValue)) {
                $this->taskLogFilter->in($fieldName, $filterValue);
                continue;
            }

            $this->taskLogFilter->eq($fieldName, (string) $filterValue);
        }
    }
1101622
private function registerFilters()
    {
        $filters = config('app.render_filters', []);

        foreach ($filters as $filter) {
            $filter = app($filter);

            if ($filter instanceof FilterContract) {
                $this->twigEnvironment->addFilter(new \Twig_SimpleFilter($filter->getName(), $filter->getFilter()));
                $this->twigStringEnvironment->addFilter(new \Twig_SimpleFilter($filter->getName(),
                    $filter->getFilter()));
            }
        }
    }
397149
public FilterRegistration.Dynamic addFilter(String name, Class<? extends Filter> klass) {
        return addFilter(name, new FilterHolder(requireNonNull(klass)));
    }
1036819
def _add_to_bulk(self, bulkobj):
        """"""
        bulkobj.add_delete(self._filter, 0, collation=self._collation)
146205
public function addAllFilters()
    {
        $fields = array_keys($this->getDataObjectInstance()->searchableFields());
        foreach ($fields as $fieldName) {
            $this->addDefaultFilters($fieldName);
        }

        return $this;
    }
1210764
def _add_to_bulk(self, bulkobj):
        """"""
        bulkobj.add_replace(self._filter, self._doc, self._upsert,
                            collation=self._collation)
820606
protected function addFilters()
    {
        if ($this->parser->getFilters()) {

            $this->query->whereRaw($this->parser->getFilters());
        }

        return $this;
    }
1003741
protected function _setupFilters()
    {
        if (!($this->_filterEnabled = $this->_isFilterEnabled())) {
            return;
        }

        $this->filterFields = $this->_getFilterFields();
        $sluggedFilter = $this->request->getParam('sluggedFilter', '');

        if ($sluggedFilter === '') {
            return;
        }

        $filterData = $this->Filters->find('filterDataBySlug', ['request' => $this->request]);

        if (empty($filterData)) {
            return;
        }

        $data = array_merge($this->request->getData(), $filterData);
        foreach ($data as $key => $value) {
            $this->request = $this->request->withData($key, $value);
        }
        $this->slug = $sluggedFilter;
    }
771760
def add_filter(self, ftype, func):
        '''  '''
        if not isinstance(ftype, type):
            raise TypeError("Expected type object, got %s" % type(ftype))
        self.castfilter = [(t, f) for (t, f) in self.castfilter if t != ftype]
        self.castfilter.append((ftype, func))
        self.castfilter.sort()
917369
function attach(filters, instance)
{
  Object.keys(filters).forEach(function(step)
  {
    filters[step].forEach(function(filter)
    {
      instance.use(step, filter);
    });
  });
}
1233937
def apply(filter):
    
    def decorator(callable):
        return lambda *args, **kwargs: filter(callable(*args, **kwargs))
    return decorator
722616
function(filterName, input, args) {
            var self            = this,
                hooks           = self.constructor.filters[filterName],
                output          = input,
                extensionName   = '';

            if (!hooks || h.isEmptyObject(hooks)) return output;

            args = args || [];

            for (extensionName in hooks) {
                args = h.arrayFromList(args);

                args.unshift(output);

                output = hooks[extensionName].apply(self, args);
            }

            return output;
        }