adds features to filters based on current content of filters.specs
175117
function addFeatures() {
        const features = {};
        for (const spec in filters.specs) {
            features[parseResults.specs.specTable[spec].feature] = true;
        }
        filters.features = features;
    }
437919
def attach_core_filters(cls):
        
        opts = cls._meta
        base_filters = cls.base_filters.copy()
        cls.base_filters.clear()
        for name, filter_ in six.iteritems(base_filters):
            if isinstance(filter_, AutoFilters):
                field = filterset.get_model_field(opts.model, filter_.name)
                filter_exclusion = filter_.extra.pop('drop', [])
                for lookup_expr in utils.lookups_for_field(field):
                    if lookup_expr not in filter_exclusion:
                        new_filter = cls.filter_for_field(field, filter_.name, lookup_expr)
                        # by convention use field name for filters with exact lookup_expr
                        if lookup_expr != 'exact':
                            filter_name = LOOKUP_SEP.join([name, lookup_expr])
                        else:
                            filter_name = name
                        cls.base_filters[filter_name] = new_filter
678123
def rest_add_filters(self, data):
        
        for _filter in data:
            filter_class = map_args_filter.get(_filter["opr"], None)
            if filter_class:
                self.add_filter(_filter["col"], filter_class, _filter["value"])
287042
def _register_custom_filters(self):
        """"""
        custom_filters = self.settings.get('CUSTOM_FILTERS', [])
        if not isinstance(custom_filters, list):
            raise KeyError("`CUSTOM_FILTERS` setting must be a list.")

        for filter_module_name in custom_filters:
            try:
                filter_module = import_module(filter_module_name)
            except ImportError as error:
                raise ImproperlyConfigured(
                    "Failed to load custom filter module '{}'.\n"
                    "Error was: {}".format(filter_module_name, error)
                )

            try:
                filter_map = getattr(filter_module, 'filters')
                if not isinstance(filter_map, dict):
                    raise TypeError
            except (AttributeError, TypeError):
                raise ImproperlyConfigured(
                    "Filter module '{}' does not define a 'filters' dictionary".format(filter_module_name)
                )
            self._environment.filters.update(filter_map)
236709
def add_filter(self, name, filter_values):
        
        # normalize the value into a list
        if not isinstance(filter_values, (tuple, list)):
            if filter_values is None:
                return
            filter_values = [filter_values, ]

        # remember the filter values for use in FacetedResponse
        self.filter_values[name] = filter_values

        # get the filter from the facet
        f = self.facets[name].add_filter(filter_values)
        if f is None:
            return

        self._filters[name] = f
736464
def add_filter(self, filter_or_string, *args, **kwargs):
        
        self.filters.append(build_filter(filter_or_string, *args, **kwargs))

        return self
632409
def add_filter_by_pattern(self, pattern, filter_type=DefaultFilterType):
        
        self.add_filter(FilterPattern(pattern), filter_type)
        return self
1013746
def apply_filters prev_filters = nil, filter_codecs = nil
      prev_filters = filter_types if prev_filters.nil?
      filter_codecs = [] if filter_codecs.nil?
      current_filters = []
      prev = nil
      line_sizes = []
      scanline_positions.push(@filtered_data.size).inject do |m, n|
        line_sizes << n - m - 1
        n
      end
      wrap_with_rewind(@filtered_data) do
        # decode all scanlines
        prev_filters.each_with_index do |type, i|
          byte = @filtered_data.read 1
          current_filters << byte.unpack('C').first
          line_size = line_sizes[i]
          line = @filtered_data.read line_size
          filter = Filter.new type, @sample_size
          if filter_codecs[i] && filter_codecs[i][:decoder]
            filter.decoder = filter_codecs[i][:decoder]
          end
          if !prev.nil? && @interlace_pass_count.include?(i + 1)  # make sure prev to be nil if interlace pass is changed
            prev = nil
          end
          decoded = filter.decode line, prev
          @filtered_data.pos -= line_size
          @filtered_data << decoded
          prev = decoded
        end
        # encode all
        filter_codecs.reverse!
        line_sizes.reverse!
        data_amount = @filtered_data.pos # should be eof
        ref = data_amount
        current_filters.reverse_each.with_index do |type, i|
          line_size = line_sizes[i]
          ref -= line_size + 1
          @filtered_data.pos = ref + 1
          line = @filtered_data.read line_size
          prev = nil
          if !line_sizes[i + 1].nil?
            @filtered_data.pos = ref - line_size
            prev = @filtered_data.read line_size
          end
          # make sure prev to be nil if interlace pass is changed
          if @interlace_pass_count.include?(current_filters.size - i)
            prev = nil
          end
          filter = Filter.new type, @sample_size
          if filter_codecs[i] && filter_codecs[i][:encoder]
            filter.encoder = filter_codecs[i][:encoder]
          end
          encoded = filter.encode line, prev
          @filtered_data.pos = ref + 1
          @filtered_data << encoded
        end
      end
    end
379759
def make_filter(**tests):
    """"""
    tests = [AttrTest(k, v) for k, v in tests.items()]
    return Filter(tests)
123467
private StyleFilter findStyleFilter(Object feature, List<StyleFilter> styles) {
		for (StyleFilter styleFilter : styles) {
			if (styleFilter.getFilter().evaluate(feature)) {
				return styleFilter;
			}
		}
		return new StyleFilterImpl();
	}
461661
function buildFilters(filters) {
    var builtFilters = [];
    filters.forEach(function(filter) {
      builtFilters.push(MongoDatabase.buildFilter(filter));
    });
    return builtFilters;
  }
648554
def load_filters(self):
        """"""
        for f in sorted(logdissect.filters.__filters__):
            self.filter_modules[f] = \
                __import__('logdissect.filters.' + f, globals(), \
                locals(), [logdissect]).FilterModule(args=self.filter_args)
434372
def show_specs(options = {})
      options = {
        mode:              nil,
        spec:              nil,
        type:              nil,
        sub_type:          nil,
        specs_to_be_shown: SpecArray.new,
        owner:             nil,
        symbol:            false,
        creating_spec:     false
      }.update(options)
      options[:symbol] ? symbol = options.delete(:spec) : symbol = nil
      specs_to_be_shown = options[:specs_to_be_shown]
      filter_hash(_specs, options[:spec]).each do |_spec, hash|
        filter_hash(hash, options[:mode]).each do |_mode, hash_|
          filter_hash(hash_, options[:type]).each do |_type, hash__|
            filter_hash(hash__, options[:sub_type]).each do |_sub_type, spec|
              if symbol
                if spec.symbol && (spec.symbol.gsub(/<.*?>/, '').downcase.to_sym == symbol)
                  specs_to_be_shown << spec
                end
              else
                specs_to_be_shown << spec
              end
            end
          end
        end
      end
      # If no specs were found must check the possibility another search
      # should be started with mode set to :local or :global
      if specs_to_be_shown.empty?
        # Don't want to re-call this method if the callee is trying to create a spec and just wants to know
        # if there is a spec with the exact same options
        if options[:creating_spec] == false
          # Doesn't make sense to recall the method however if the mode is already set to :global or :local
          unless [:global, :local, nil].include?(options[:mode])
            # Need to check if there are :global or :local specs that match the filter(s) as well
            if self == Origen.top_level
              options[:mode] = :global
            else
              options[:mode] = :local
            end
            options[:specs_to_be_shown] = specs_to_be_shown
            Origen.log.debug "re-calling show_specs with options #{options}"
            return show_specs(options)
          end
        end
        Origen.log.debug "Returning no specs for options #{options}"
        return nil
      elsif specs_to_be_shown.size == 1
        print_to_console(specs_to_be_shown) if options[:verbose] == true
        Origen.log.debug "returning one spec #{specs_to_be_shown.first.name}"
        return specs_to_be_shown.first
      else
        Origen.log.debug "returning an array of specs during initial search: #{specs_to_be_shown}"
        return specs_to_be_shown
      end
    end
399560
def _parse_example_spec(self):
    """"""
    height, width = image_util.get_expected_image_size(self.module_spec)
    input_shape = [height, width, 3]
    return {self.key: tf_v1.FixedLenFeature(input_shape, tf.float32)}
857050
def combine(specs):
        
        new_specs = {}
        for spec in specs:
            if new_specs.get(spec, None) is None:
                new_specs[spec] = spec
            else:
                new_specs[spec].add(spec)
        return list(new_specs.values())
510554
def create_filters(model, filter_info, resource):
    
    filters = []
    for filter_ in filter_info:
        filters.append(Node(model, filter_, resource, resource.schema).resolve())

    return filters
338967
function (filters, tpl) {
      for (var i = 0; i < filters.length; ++i) {
        tpl = filters[i](tpl)
      }
      return tpl
    }