Return list of browser exclusion rules defined in the Configuration.
198714
def exclusions(self):
        
        exclusion_rules = [
            r.strip()
            for r in self.config.get("browser_exclude_rule", "").split(",")
            if r.strip()
        ]
        return exclusion_rules
142634
def compile_excludes(self):
        """"""
        self.compiled_exclude_files = []
        for pattern in self.exclude_files:
            try:
                self.compiled_exclude_files.append(re.compile(pattern))
            except re.error as e:
                raise ValueError(
                    "Bad python regex in exclude '%s': %s" % (pattern, str(e)))
1234518
def rules(self):
        
        list_of_rules = []

        for main_row in self.dict_rules:
            if 'rules' in main_row:
                for rule_row in main_row['rules']:
                    if 'grants' in rule_row:
                        for grant_row in rule_row['grants']:
                            if 'group_id' in grant_row:
                                # Set a var to not go over 80 chars
                                group_id = grant_row['group_id']

                                # Some VPC grants don't specify a name
                                if 'name' in grant_row:
                                    row_name = grant_row['name']
                                else:
                                    row_name = None

                                fr = FirewallRule(
                                    main_row['id'],
                                    main_row['name'],
                                    main_row['description'],
                                    rules_direction=rule_row['direction'],
                                    rules_ip_protocol=rule_row['ip_protocol'],
                                    rules_from_port=rule_row['from_port'],
                                    rules_to_port=rule_row['to_port'],
                                    rules_grants_group_id=group_id,
                                    rules_grants_name=row_name,
                                    rules_description=grant_row['description'])

                                list_of_rules.append(fr)
                            elif 'cidr_ip' in grant_row:
                                fr = FirewallRule(
                                    main_row['id'],
                                    main_row['name'],
                                    main_row['description'],
                                    rules_direction=rule_row['direction'],
                                    rules_ip_protocol=rule_row['ip_protocol'],
                                    rules_from_port=rule_row['from_port'],
                                    rules_to_port=rule_row['to_port'],
                                    rules_grants_cidr_ip=grant_row['cidr_ip'],
                                    rules_description=grant_row['description'])
                                list_of_rules.append(fr)
                            else:
                                raise ValueError("Unsupported grant:",
                                                 grant_row)
                    else:
                        fr = FirewallRule(
                            main_row['id'],
                            main_row['name'],
                            main_row['description'],
                            rules_direction=rule_row['direction'],
                            rules_ip_protocol=rule_row['ip_protocol'],
                            rules_from_port=rule_row['from_port'],
                            rules_to_port=rule_row['to_port'])
                        list_of_rules.append(fr)
            else:
                fr = FirewallRule(main_row['id'],
                                  main_row['name'],
                                  main_row['description'])
                list_of_rules.append(fr)

        # Sort the data in order to get a consistent output
        sorted_list = sorted(list_of_rules,
                             key=lambda fr: (str(fr.id),
                                             str(fr.name),
                                             str(fr.description),
                                             str(fr.rules_direction),
                                             str(fr.rules_ip_protocol),
                                             str(fr.rules_from_port),
                                             str(fr.rules_to_port),
                                             str(fr.rules_grants_group_id),
                                             str(fr.rules_grants_name),
                                             str(fr.rules_grants_cidr_ip)))

        return sorted_list
367658
def allowed_methods(self, path_info=None):
        
        try:
            self.match(path_info, method="--")
        except MethodNotAllowed as e:
            return e.valid_methods
        except HTTPException:
            pass
        return []
713832
def setup(self):
        """"""
        super(RequireJSFilter, self).setup()

        excluded_files = []
        for bundle in self.excluded_bundles:
            excluded_files.extend(
                map(lambda f: os.path.splitext(f)[0],
                    bundle.contents)
            )

        if excluded_files:
            self.argv.append(
                'exclude={0}'.format(','.join(excluded_files))
            )
832466
function excludeElements(exclude) {
      return Array.isArray(exclude) ? exclude.forEach(function(selector) {
        // Use querySelectorAll to hide all dom element with the specified selector
        var selectorAll = document.querySelectorAll(selector);

        if(selectorAll.length) {
          // Interate through NodeList
          for(var i = 0; i < selectorAll.length; i++) {
            selectorAll.item(i).style.visibility = 'hidden';
          }
        }
      }) : false;
    }
1049720
def list_firewall_policies(self, retrieve_all=True, **_params):
        """"""
        # Pass filters in "params" argument to do_request

        return self.list('firewall_policies', self.firewall_policies_path,
                         retrieve_all, **_params)
42865
def get_enabled_browsers():
    
    global _enabled_browsers_cache
    if _enabled_browsers_cache is not None:
        return _enabled_browsers_cache
    enabled = []
    for browser_path in settings.ADMINFILES_BROWSER_VIEWS:
        try:
            view_class = import_browser(browser_path)
        except ImportError:
            continue
        if not issubclass(view_class, BaseView):
            continue
        browser = view_class
        try:
            browser.check()
        except DisableView:
            continue
        enabled.append(browser)
    _enabled_browsers_cache = enabled
    return enabled
727838
public function list_rules()
    {
        $result = array();
        $i      = 1;

        foreach ($this->script as $idx => $filter) {
            if (empty($filter['actions'])) {
                continue;
            }
            $fname = $filter['name'] ?: "#$i";
            $result[] = array(
                'id'    => $idx,
                'name'  => $fname,
                'class' => $filter['disabled'] ? 'disabled' : '',
            );
            $i++;
        }

        return $result;
    }
698930
function getChildRules(css, parent) {
  var result = [];
  var selectorRegExp = new RegExp(parent.selector);

  // Walk all rules to mach child selectors
  css.walkRules(selectorRegExp, function (rule) {
    var childRule = (0, _matchChild.matchChild)(parent, rule);
    if (childRule) {
      result.push(rule);
    }
  });

  // Walk all at-rules to match nested child selectors
  css.walkAtRules(function (atRule) {
    atRule.walkRules(selectorRegExp, function (rule) {
      var childRule = (0, _matchChild.matchChild)(parent, rule);
      // Create new at-rule to append only necessary selector to critical
      var criticalAtRule = _postcss2.default.atRule({
        name: atRule.name,
        params: atRule.params
      });
      /**
       * Should append even if parent selector, but make sure the two rules
       * aren't identical.
       */
      if ((rule.selector === parent.selector || childRule) && _postcss2.default.parse(rule).toString() !== _postcss2.default.parse(parent).toString()) {
        var clone = rule.clone();
        criticalAtRule.append(clone);
        result.push(criticalAtRule);
      }
    });
  });

  return result;
}
841515
def filtered_entries(self):
        """"""
        return [
            e for e in self.entries if not any(fnmatch.fnmatch(e.name.lower(), p.lower()) for p in self.exclude_list)
        ]
274801
def list_bandwidth_limit_rules(self, policy_id,
                                   retrieve_all=True, **_params):
        """"""
        return self.list('bandwidth_limit_rules',
                         self.qos_bandwidth_limit_rules_path % policy_id,
                         retrieve_all, **_params)
781291
def matches(filter, message, valid_paths, rule_cache, config):
    

    if not filter['rules']:
        return False

    for rule in filter['rules']:
        fn = rule['fn']
        negated = rule['negated']
        arguments = rule['arguments']
        rule_cache_key = rule['cache_key']

        try:
            if rule_cache_key not in rule_cache:
                value = fn(config, message, **arguments)
                if negated:
                    value = not value
                rule_cache[rule_cache_key] =  value

            if not rule_cache[rule_cache_key]:
                return False
        except Exception as e:
            log.exception(e)
            # If something throws an exception then we do *not* have a match.
            return False

    # Then all rules matched on this filter..
    return True
182489
def filtered(self):
        """"""
        if not is_tagged(self.tags, self.opt.tags):
            LOG.info("Skipping %s as it does not have requested tags",
                     self.path)
            return False

        if not specific_path_check(self.path, self.opt):
            LOG.info("Skipping %s as it does not match specified paths",
                     self.path)
            return False

        return True
750527
def _exclude_paths_from_environ(env_prefix=''):
    """"""
    paths = os.environ.get(env_prefix + 'WSGI_AUTH_EXCLUDE_PATHS')
    if not paths:
        return []
    return paths.split(';')
499230
def normalize_excludes(excludes):
    """"""
    return [os.path.normpath(os.path.abspath(exclude)) for exclude in excludes]
89733
def get_filter_fields(self, exclude=None):
        

        exclude_set = set(self.exclude)
        if exclude:
            exclude_set = exclude_set.union(set(exclude))

        return [name for name in self.fields
                if name not in exclude_set]