Static configurator for filter
3581
protected static function configure(AspectKernel $kernel, string $filterName, CachePathManager $cacheManager): void
    {
        if (self::$kernel !== null) {
            throw new RuntimeException('Filter injector can be configured only once.');
        }
        self::$kernel           = $kernel;
        self::$options          = $kernel->getOptions();
        self::$filterName       = $filterName;
        self::$cachePathManager = $cacheManager;
    }
747444
function visibilityFilter(state = SHOW_ALL, action = {}) {
    const {type, filter} = action;
    switch (type) {
        case SET_VISIBILITY_FILTER:
            return filter;
        default:
            return state;
    }
}
1306775
static FilterImpl create(final String path, final Filter filter) {
        return create(path, DEFAULT_ACCEPT_TYPE, filter);
    }
1369422
public void setFilter(Filter filter)
    {
        if (this.filter == null)
        {
            this.filter = new FilterList();
        }
        if (filter != null)
        {
            this.filter.addFilter(filter);
        }
    }
78707
def build_filter
      raise(ArgumentError, 'Cannot supply both a filter and an exclusion filter') if include_filter && exclude_filter

      filter                  = where_filter
      (filter ||= {})['_type'] = include_filter if include_filter
      (filter ||= {})['_type'] = {'$not' => exclude_filter} if exclude_filter
      filter
    end
1052053
function getFilters(resourceName, adapterName, operation) {
    var filterConfig = injector.loadModule('filterConfig');
    var filters = { before: [], after: [] };

    if (!filterConfig) { return filters; }

    var levels = [resourceName, adapterName, operation, 'before'];
    filters.before = (traverseFilters(filterConfig, levels, 0) || []).map(function (name) {
        return injector.loadModule(name + 'Filter');
    });

    levels = [resourceName, adapterName, operation, 'after'];
    filters.after = (traverseFilters(filterConfig, levels, 0) || []).map(function (name) {
        return injector.loadModule(name + 'Filter');
    });

    return filters;
}
1078788
def add_filter(self, filter):
        
        if not isinstance(filter, AbstractFilter):
            err = 'Filters must be of type {}'.format(AbstractFilter)
            raise InvalidFilter(err)

        if filter not in self.filters:
            self.filters.append(filter)
        return self
747713
function setFilters (config) {
  const parts = config.filter.split(/[\s,]+/)
  config.filters = {
    should: {},
    ignore: {}
  }
  _.each(parts, addFilter.bind(null, config))
}
940244
def setup_filter(self, ):
        
        types = self.refobjinter.types.keys()
        for i, t in enumerate(types):
            cb = QtGui.QCheckBox("%s" % t)
            cb.setChecked(True)
            cb.toggled.connect(self.update_filter)
            self.typecbmap[t] = cb
            self.typefilter_grid.addWidget(cb, int(i / 4), i % 4)
447214
function configurator (location) {
  return !(location && fs.existsSync(location))
    ? {}
    : JSON.parse(
        fs.readFileSync(location, 'UTF-8')
          .replace(/\/\*[\s\S]*(?:\*\/)/g, '') // removes /* comments */
          .replace(/\/\/[^\n\r]*/g, '') // removes // comments
      );
}
362435
def setFilterData(self, key, value):
        
        self._filterData[nativestring(key)] = nativestring(value)
1222730
@Override
    @FFDCIgnore(SecurityException.class)
    public ExtendedConfiguration[] listConfigurations(String filterString) throws InvalidSyntaxException {
        if (filterString == null)
            filterString = "(" + Constants.SERVICE_PID + "=*)"; //$NON-NLS-1$ //$NON-NLS-2$

        try {
            this.caFactory.checkConfigurationPermission();
        } catch (SecurityException e) {
            filterString = "(&(" + ConfigurationAdmin.SERVICE_BUNDLELOCATION + "=" + bundle.getLocation() + ")" + filterString + ")";
        }
        return caFactory.getConfigurationStore().listConfigurations(FrameworkUtil.createFilter(filterString));
    }
465966
def Compile(self, filter_implementation):
    """"""
    operator = self.operator.lower()
    if operator in ('and', '&&'):
      method = 'AndFilter'
    elif operator in ('or', '||'):
      method = 'OrFilter'
    else:
      raise errors.ParseError(
          'Invalid binary operator {0:s}.'.format(operator))

    args = [x.Compile(filter_implementation) for x in self.args]
    return filter_implementation.FILTERS[method](arguments=args)
133363
def fix_config(self, options):
        
        opt = "setup"
        if opt not in options:
            options[opt] = filters.Filter(classname="weka.filters.AllFilter")
        if opt not in self.help:
            self.help[opt] = "The filter to apply to the dataset (Filter)."

        opt = "keep_relationname"
        if opt not in options:
            options[opt] = False
        if opt not in self.help:
            self.help[opt] = "Whether to keep the original relation name (bool)."

        return super(Filter, self).fix_config(options)
1133987
def filter_factory(global_conf, **local_conf):
    """"""
    conf = global_conf.copy()
    conf.update(local_conf)

    def auth_filter(app):
        return Swauth(app, conf)
    return auth_filter
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;
        }
1157853
def add_filter(filter = nil, &block)
      id = "#{filter.inspect}/#{block.inspect}".hash

      @filters[id] = if filter.kind_of?(Filter)
                       filter
                     elsif filter.kind_of?(String)
                       StringFilter.new(filter)
                     elsif filter.kind_of?(Regexp)
                       RegexpFilter.new(filter)
                     elsif block
                       BlockFilter.new(block)
                     else
                       raise ArgumentError, 'Please specify either a string, ' \
                         'filter, or block to filter source files with!'
                     end

      true
    end