Returns a filter used during dependency analysis
489165
private JdepsFilter dependencyFilter(JdepsConfiguration config) {
        // Filter specified by -filter, -package, -regex, and --require options
        JdepsFilter.Builder builder = new JdepsFilter.Builder();

        // source filters
        builder.includePattern(options.includePattern);

        // target filters
        builder.filter(options.filterSamePackage, options.filterSameArchive);
        builder.findJDKInternals(options.findJDKInternals);

        // --require
        if (!options.requires.isEmpty()) {
            options.requires.stream()
                .forEach(mn -> {
                    Module m = config.findModule(mn).get();
                    builder.requires(mn, m.packages());
                });
        }
        // -regex
        if (options.regex != null)
            builder.regex(options.regex);
        // -package
        if (!options.packageNames.isEmpty())
            builder.packages(options.packageNames);
        // -filter
        if (options.filterRegex != null)
            builder.filter(options.filterRegex);

        return builder.build();
    }
852764
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 getattr(filter_implementation, method)(*args)
666841
def filter_module(module, filter_type):
        
        filter_type = ModuleUtils.is_function if filter_type == "function" else ModuleUtils.is_variable
        module_functions_dict = dict(filter(filter_type, vars(module).items()))
        return module_functions_dict
397304
def filter_t(func):
    
    return Transformation('filter({0})'.format(name(func)),
                          partial(filter, func),
                          {ExecutionStrategies.PARALLEL})
827821
def filter(self):
        '''
        
        '''

        if self.deprecated_filtering_enabled():
            print('warning: event filtering in sensu-plugin is deprecated,' +
                  'see http://bit.ly/sensu-plugin')
            self.filter_disabled()
            self.filter_silenced()
            self.filter_dependencies()

            if self.deprecated_occurrence_filtering():
                print('warning: occurrence filtering in sensu-plugin is' +
                      'deprecated, see http://bit.ly/sensu-plugin')
                self.filter_repeated()
1138113
def parse(cls, representation, corpus=None):
        

        criteria_definitions = representation.split('\n')
        criteria = []

        for i in range(0, len(criteria_definitions), 2):
            filter_name = criteria_definitions[i]
            filter_repr = criteria_definitions[i + 1]

            if filter_name not in available_filter_criteria():
                raise UnknownFilterCriteriaException('Unknown filter-criterion {}'.format(filter_name))

            criterion = available_filter_criteria()[filter_name].parse(filter_repr)
            criteria.append(criterion)

        return cls(corpus, criteria)
1361712
function getLanguageFilter(languageId) {
        return function languageFilter(file) {
            var id = LanguageManager.getLanguageForPath(file.fullPath).getId();
            if (typeof languageId === "string") {
                return (id === languageId);
            } else {
                return (languageId.indexOf(id) !== -1);
            }
        };
    }
783022
def get_filter_rule(self, _filter, way='in'):
        
        if isinstance(_filter, zobjects.FilterRule):
            _filter = _filter.name
        for f in self.get_filter_rules(way=way):
            if f.name == _filter:
                return f
        return None
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;
}
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
1317374
def dependencies(self):
        
        extra_input_rows = max(0, self.window_length - 1)
        out = {}
        for term in self.inputs:
            out[term] = extra_input_rows
        out[self.mask] = 0
        return out
1140586
def find_filter_class(filtername):
    """"""
    if filtername in FILTERS:
        return FILTERS[filtername]
    for name, cls in find_plugin_filters():
        if name == filtername:
            return cls
    return None
381929
def _get_struct_convolutionfilter(self):
        """"""
        obj = _make_object("ConvolutionFilter")
        obj.MatrixX = unpack_ui8(self._src)
        obj.MatrixY = unpack_ui8(self._src)
        obj.Divisor = unpack_float(self._src)
        obj.Bias = unpack_float(self._src)

        _quant = obj.MatrixX * obj.MatrixY
        obj.Matrix = [unpack_float(self._src) for _ in range(_quant)]

        obj.DefaultColor = self._get_struct_rgba()
        bc = BitConsumer(self._src)
        obj.Reserved = bc.u_get(6)
        obj.Clamp = bc.u_get(1)
        obj.PreserveAlpha = bc.u_get(1)
        return obj
647041
private function getFiltersNormalizer(): Closure
    {
        return function(Options $options, $data) {
            $normalizedData = [];

            foreach ($data as $name => $field) {
                if (is_string($field)) {
                    $field = [
                        'type' => $field,
                        'options' => [],
                    ];
                }
                $field['name'] = $name;

                $resolver = new OptionsResolver();
                $filterConfiguration = new FilterConfiguration();
                $filterConfiguration->configureOptions($resolver);
                $filterConfiguration->setParameters($resolver->resolve($field));

                $normalizedData[$name] = $filterConfiguration->getParameters();
            }

            return $normalizedData;
        };
    }
1347037
function filterGenerator(filter) {
	if(typeof filter === "boolean")
		return () => filter;

	if(typeof filter === "function")
		return filter;

	if(filter instanceof RegExp)
		return input => filter.test(input);

	if(filter instanceof Set)
		return input => filter.has(input);

	if(filter instanceof Map)
		return input => !!filter.get(input);

	if(Array.isArray(filter))
		return input => filter.indexOf(input) !== -1;

	if(filter && typeof filter === "object")
		return input => !!filter[input];

	throw new TypeError("Invalid filter type.");
}
127655
function getFilterFn(layer, symbolizer) {
    const symbolizers = Object.keys(layer.shader)
        .filter(property => layer.shader[property].symbolizer === symbolizer);

    //No need to set a callback when at least one property is not filtered (i.e. it always activates the symbolizer)
    const alwaysActive = symbolizers
        .reduce((a, property) => a || !layer.shader[property].filtered, false);

    if (alwaysActive) {
        return undefined;
    }

    const fn = symbolizers
        .map((property) => layer.shader[property].js)
        .reduce((all, arr) => all.concat(arr), [])
        .join('');

    return wrapFn(`var _value = null; ${fn} return _value !== null;`);
}
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