Checks if the given rule matches with any filter added.

        :param rule: The Flask rule to be matched.
        :return: True if there is a filter that matches.
160722
def match(self, rule):
        
        if len(self.filters) == 0:
            return True

        for filter in self.filters:
            if filter.match(rule):
                return True
        return False
1336585
function(rule) {
      var ans = arguments[1] !== undefined ? [arguments[1]] : [],
          state;
      while (true) {
        state = this.bt.current_state();
        try { ans.push(rule.call(this)) } 
        catch (f) {
          this.bt.catch_mismatch(f);
          this.bt.restore(state);
          break;
        }
      }
      return ans
    }
955860
def is_applicable_selector(selector, filter):
    
    for test in selector.allTests():
        if not test.isCompatible(filter.tests):
            return False
    
    return True
387958
def with_rule(self, rule):
        
        self.rules = self.rules if self.rules != None else []
        self.rules.append(rule)
        return self
1171418
def apply_filter_rule(self, _filter, query='in:inbox', way='in'):
        
        if isinstance(_filter, zobjects.FilterRule):
            _filter = _filter.name

        content = {
            'filterRules': {
                'filterRule': {'name': _filter}
                },
            'query': {'_content': query}
        }
        if way == 'in':
            ids = self.request('ApplyFilterRules', content)
        elif way == 'out':
            ids = self.request('ApplyOutgoingFilterRules', content)

        if ids:
            return [int(m) for m in ids['m']['ids'].split(',')]
        else:
            return []
963478
def matches(self, ldap_filter):
        # type: (Any[str, pelix.ldapfilter.LDAPFilter]) -> bool
        
        return pelix.ldapfilter.get_ldap_filter(ldap_filter).matches(
            self.__properties
        )
698410
def parse_fuzzy_rule(self, rule):
        
        url_prefix = rule.get('url_prefix')
        config = rule.get('fuzzy_lookup')
        if not config:
            return

        if not isinstance(url_prefix, list):
            url_prefix = [url_prefix]

        if not isinstance(config, dict):
            regex = self.make_regex(config)
            replace_after = self.DEFAULT_REPLACE_AFTER
            filter_str = self.DEFAULT_FILTER
            match_type = self.DEFAULT_MATCH_TYPE
            find_all = False

        else:
            regex = self.make_regex(config.get('match'))
            replace_after = config.get('replace', self.DEFAULT_REPLACE_AFTER)
            filter_str = config.get('filter', self.DEFAULT_FILTER)
            match_type = config.get('type', self.DEFAULT_MATCH_TYPE)
            find_all = config.get('find_all', False)

        return FuzzyRule(url_prefix, regex, replace_after, filter_str, match_type, find_all)
1181322
def get_rule(self, template_name):
        
        for regex, render_func in self.rules:
            if re.match(regex, template_name):
                return render_func
        raise ValueError("no matching rule")
368906
def should_ignore_rule(self, rule):
        
        return rule.id in self.config.ignore or rule.name in self.config.ignore
1022520
def match?(time, base)
      aligned?(time, base) && @filters.all? { |f| f.match?(time) }
    end
1235732
def rule_match(component, cmd):
    ''''''
    if component == cmd:
        return True
    expanded = rule_expand(component, cmd)
    if cmd in expanded:
        return True
    return False
530377
def is_match(self, command):
        
        if command.output is None and self.requires_output:
            return False

        try:
            with logs.debug_time(u'Trying rule: {};'.format(self.name)):
                if self.match(command):
                    return True
        except Exception:
            logs.rule_failed(self, sys.exc_info())
267851
private function isRule($rule) {

		if(false === is_string($rule)) {
			return false;
		}

		$class = $this -> getRuleClass($rule);

		return true === class_exists($class);
	}
502465
boolean containsRule( Rule rule ) {
        for( int i = state.stackIdx - 1; i >= 0; i-- ) {
            if( rule == state.stack.get( i ).mixin ) {
                return true;
            }
        }
        return false;
    }
500179
function isMatchRule(req, pathname, rule) {
  if (typeof rule === 'string') {
    return pathname.indexOf(rule) > -1;
  } else if (rule instanceof RegExp) {
    return rule.test(pathname);
  } else if (typeof rule === 'function') {
    return rule(pathname, req);
  }
}
1306297
def _build_filter(*patterns):
        
        return lambda name: any(fnmatchcase(name, pat=pat) for pat in patterns)
592775
def is_matching_rule(self, request):
		""""""
		# First, if in DEBUG mode and with django-debug-toolbar, we skip
		#   this entire process.
		if settings.DEBUG and request.path.startswith("/__debug__"):
			return True

		# Second we check against matches
		match = resolve(request.path, getattr(request, "urlconf", settings.ROOT_URLCONF))
		if "({0})".format(match.app_name) in EXEMPT:
			return True

		if "[{0}]".format(match.namespace) in EXEMPT:
			return True

		if "{0}:{1}".format(match.namespace, match.url_name) in EXEMPT:
			return True

		if match.url_name in EXEMPT:
			return True

		# Third, we check wildcards:
		for exempt in [x for x in EXEMPT if x.startswith("fn:")]:
			exempt = exempt.replace("fn:", "")
			if fnmatch.fnmatch(request.path, exempt):
				return True

		return False