TODO: set filters directly, rather than relying on routes
342444
function FooterView(vm, app, key, opts) {
	function filtItem(name) {
		var upper = name[0].toUpperCase() + name.slice(1);

		return el("li", [
			el("a", {class: opts.filter == name ? "selected" : null, href: "#/"+name}, upper),
		]);
	}

	return () => {
		var notDone = app.items.filter(item => !item.done).length;

		return el("footer#footer", [
			el("span#todo-count", [
				el("strong", notDone),
				" item" + (notDone == 1 ? "" : "s") + " left"
			]),
			el("ul#filters", ["all","active","completed"].map(
				filtItem
			)),
			app.items.length > notDone && el("button#clear-completed", {onclick: app.clearDone}, "Clear completed")
		])
	}
}
1147466
function filter(data, action, format) {
  return walk(data, action, format, data.meta || data[0].unMeta);
}
830266
function matchRoutes(routes, path, query) {
  query = query === undefined ? {} : isString(query) ? qs.parse(query) : query;
  return matchRoutesImpl(routes, path, query);
}
779505
public function callRouteFilter($filter, $parameters, $route, $request, $response = null)
	{
		$data = array_merge(array($route, $request, $response), $parameters);

		return $this->events->until('router.filter: '.$filter, $this->cleanFilterParameters($data));
	}
688012
function getFilters(type, controller, action) {
  // User can set 'only' and 'except' rules on filters to be used on one
  // or many action methods.
  let useOptions = { only: true, except: false }

  // Only return action filter methods that apply.
  return _.filter(controller[`__${type}Filters`], filter => {
    // An action must be defined in each filter.
    if(!('action' in filter) || !filter.action)
      throw new Error(`No action defined in filter for [${controller.constructor.name}.${type}: ${JSON.stringify(filter)}].`)

    // Filter cannot contain both options.
    let containsBoth = _.every(_.keys(useOptions), o => o in filter)
    if(containsBoth)
      throw new Error(`${type[0].toUpperCase() + type.slice(1)} filter cannot have both \'only\' and \'except\' keys.`)

    let option = _.first(_.intersection(_.keys(useOptions), _.keys(filter)))
    // If no option is defined, use for all actions.
    if(!option)
      return true

    let useActions, use = useOptions[option]
    useActions = typeof (useActions = filter[option]) === 'string' ? [useActions] : useActions
    // Determine if filter can be used for this action.
    for(let ua of useActions)
      if(ua === action)
        return use

    return !use
  })
}
787036
def filter(params)
      if @filter_params
        filtered_params = {}
        params.each { |k, p| filtered_params[k] = @filter_params.include?(k.to_s) ? FILTERED_PARAM_VALUE : p }
        filtered_params
      end
    end
1072745
def _init_filters(self):
        """"""
        self.filters = {}

        @self.template_filter()
        def format_ts(value, format_='%a, %b %d %Y %H:%M:%S'):
            """Formats the supplied timestamp using format_

            :param str value: The timestamp to be formatted
            :param str format_:  The format string
            :return: The correctly formatted timestamp as determined by format_
            :rtype: str
            """
            if format_ == '%s':
                return timestamp_to_sec(value)
            else:
                value = timestamp_to_datetime(value)
                return value.strftime(format_)

        @self.template_filter('urlsplit')
        def get_urlsplit(url):
            """Splits the supplied URL

            :param str url: The url to be split
            :return: The split url
            :rtype: urllib.parse.SplitResult
            """
            split = urlsplit(url)
            return split

        @self.template_filter()
        def tojson(obj):
            """Converts the supplied object/array/any to a JSON string if it can be JSONified

            :param any obj: The value to be converted to a JSON string
            :return: The JSON string representation of the supplied value
            :rtype: str
            """
            return json.dumps(obj)

        @self.template_filter()
        def tobool(bool_val):
            """Converts a python boolean to a JS "true" or "false" string
            :param any obj: A value to be evaluated as a boolean
            :return: The string "true" or "false" to be inserted into JS
            """

            return 'true' if bool_val else 'false'
1194218
function filterByMethods(req) {
        if(_config.allowedMethods) {
            return _config.allowedMethods.indexOf(req.method) > -1;
        } else if(_config.blockedMethods){
            return !(_config.blockedMethods.indexOf(req.method) > -1);
        } else {
            return true;
        }
    }
958650
function extraFilters(options) {
        if (!options.staticPages && !options.status) {
            return null;
        }

        let filter = null;

        // CASE: "staticPages" is passed
        if (options.staticPages && options.staticPages !== 'all') {
            // CASE: convert string true/false to boolean
            if (!_.isBoolean(options.staticPages)) {
                options.staticPages = _.includes(['true', '1'], options.staticPages);
            }

            filter = `page:${options.staticPages}`;
        } else if (options.staticPages === 'all') {
            filter = 'page:[true, false]';
        }

        // CASE: "status" is passed, combine filters
        if (options.status && options.status !== 'all') {
            options.status = _.includes(ALL_STATUSES, options.status) ? options.status : 'published';

            if (!filter) {
                filter = `status:${options.status}`;
            } else {
                filter = `${filter}+status:${options.status}`;
            }
        } else if (options.status === 'all') {
            if (!filter) {
                filter = `status:[${ALL_STATUSES}]`;
            } else {
                filter = `${filter}+status:[${ALL_STATUSES}]`;
            }
        }

        delete options.status;
        delete options.staticPages;
        return filter;
    }
7701
public static lbroute[] get_filtered(nitro_service service, String filter) throws Exception{
		lbroute obj = new lbroute();
		options option = new options();
		option.set_filter(filter);
		lbroute[] response = (lbroute[]) obj.getfiltered(service, option);
		return response;
	}
115211
function filterValidPaths(type, paths, version) {
		var valid = [];
		
		version = env.schema[version] || env.schema['5.1'];
		
		_.forEach(paths, function(p) {
			if (env.schema.hasProperty(version, type, p)) {
				valid.push(p);
			}
		});
		
		return valid;
	}
1365630
def filtered(self, efilter):
        '''
        
        '''
        if not self.params:
            self.params={'filter' : efilter}
            return self
        if not self.params.has_key('filter'):
            self.params['filter'] = efilter
            return self
        self.params['filter'].update(efilter)
        return self
209728
def filter!(type, base = settings)
      filter! type, base.superclass if base.superclass.respond_to?(:filters)
      base.filters[type].each { |args| process_route(*args) }
    end
351639
void setFilters(Map<Object, Object> filters) {

        for (Object column : filters.keySet()) {
            Object filterValue = filters.get(column);
            if ((filterValue != null) && !filterValue.toString().isEmpty() && !m_table.isColumnCollapsed(column)) {
                m_table.setFilterFieldValue(column, filterValue);
            }
        }
    }
98457
private void filterAfter(Route route) {
        try {
            List<HttpSupportFilter> filters = Configuration.getFilters();
            for (int i = filters.size() - 1; i >= 0; i--) {
                HttpSupportFilter filter = filters.get(i);
                if(Configuration.getFilterMetadata(filter).matches(route)){
                    LOGGER.debug("Executing filter: " + filter.getClass().getName() + "#after");
                    filters.get(i).after();
                }else {
                    LOGGER.debug("Filter: " + filter.getClass().getName() + "#after does not match route: " + route );
                }
            }
        } catch (Exception e) {
            throw new FilterException(e);
        }
    }
194372
function(target, filter) {
      _.each(slice.call(arguments, 2), function(source) {
        var prop, _results;
        _results = [];
        for (prop in source) {
          if (source[prop] !== void 0 && _.include(filter, prop)) {
            _results.push(target[prop] = source[prop]);
          } else {
            _results.push(void 0);
          }
        }
        return _results;
      });
      return target;
    }
360706
function setFilters(swig, filters) {
  for (var name in filters) {
    swig.setFilter(name, filters[name]);
  }
}