Returns all enabled rules.

    :rtype: [Rule]
966026
def get_rules():
    
    paths = [rule_path for path in get_rules_import_paths()
             for rule_path in sorted(path.glob('*.py'))]
    return sorted(get_loaded_rules(paths),
                  key=lambda rule: rule.priority)
398837
def list_security_group_rules(self, retrieve_all=True, **_params):
        """"""
        return self.list('security_group_rules',
                         self.security_group_rules_path,
                         retrieve_all, **_params)
829228
def wildcard_allowed_actions(self, pattern=None):
        

        wildcard_allowed = []

        for statement in self.statements:
            if statement.wildcard_actions(pattern) and statement.effect == "Allow":
                wildcard_allowed.append(statement)

        return wildcard_allowed
545314
public static function get_enabled_plugins() {
        global $DB, $CFG;
        require_once("$CFG->libdir/filterlib.php");

        $enabled = array();
        $filters = $DB->get_records_select('filter_active', "active <> :disabled AND contextid = :contextid", array(
            'disabled' => TEXTFILTER_DISABLED, 'contextid' => \context_system::instance()->id), 'filter ASC', 'id, filter');
        foreach ($filters as $filter) {
            $enabled[$filter->filter] = $filter->filter;
        }

        return $enabled;
    }
370226
def get_enabled(self) -> List[ScheduledTransaction]:
        
        query = (
            self.query
            .filter(ScheduledTransaction.enabled == True)
        )
        return query.all()
411270
def temporarily_enabled(self):
        
        old_setting = self.options.enabled
        self.enable()
        try:
            yield
        finally:
            self.options.enabled = old_setting
970107
def sync(self, rules: list):
        
        self._reset()
        old_rules = self.rules
        to_delete_rules = [
            rule for rule in old_rules
            if rule not in rules
        ]
        new_rules = [
            rule for rule in rules
            if rule not in old_rules
        ]

        for new_rule in new_rules:
            assert isinstance(new_rule, Rule)
            self._exec_command(new_rule.add_command)
        for to_delete_rule in to_delete_rules:
            assert isinstance(to_delete_rule, Rule)
            self._exec_command(
                to_delete_rule.remove_command
            )
        self._update(rules)
1320316
def rulefiles(self, acc=None):
        
        rulesdir = self.rulesdir(acc)
        rules = [os.path.join(rulesdir, x) for x in self.get('rules', acc, [])]
        if acc is not None:
            rules += self.rulefiles(acc=None)
        return rules
782234
def all_checks_enabled(self):
        ''' '''
        arming_mask = int(self.get_mav_param("ARMING_CHECK",0))
        if arming_mask == 1:
            return True
        for bit in arming_masks.values():
            if not arming_mask & bit and bit != 1:
                return False
        return True
1082385
def get_rules(self, optimized):
        
        self.insert_start_to_accepting()
        # If CFG is not requested, avoid the following O(n^3) rule.
        # It can be solved and a string can be generated faster with BFS of DFS

        if optimized == 0:
            self.insert_self_to_empty_and_insert_all_intemediate(optimized)
        self.insert_symbol_pushpop()
        return self.rules
1240337
def list_metering_label_rules(self, retrieve_all=True, **_params):
        """"""
        return self.list('metering_label_rules',
                         self.metering_label_rules_path, retrieve_all,
                         **_params)
204145
def enabled_logical_ids(self):
        
        return [logical_id for logical_id, preference in self._resource_preferences.items() if preference.enabled]
1260574
def enable_disable(self):
        
        if self.enabled:
            self.data['enabled'] = False
        else:
            self.data['enabled'] = True
        self.update()
1216487
def get_cameras_rules(self):
        """"""
        resource = "rules"
        rules_event = self.publish_and_get_event(resource)
        if rules_event:
            return rules_event.get('properties')

        return None
1262608
def change_enables(self, enables_list: list):
        
        for i, entry in enumerate(self.values):
            if enables_list[i]:
                entry.config(state=tk.NORMAL)
            else:
                entry.config(state=tk.DISABLED)
152285
def parse_services(rule):
    '''
    
    '''
    parser = argparse.ArgumentParser()
    rules = shlex.split(rule)
    rules.pop(0)
    parser.add_argument('--disabled', dest='disabled', action='store')
    parser.add_argument('--enabled', dest='enabled', action='store')

    args = clean_args(vars(parser.parse_args(rules)))
    parser = None
    return args
516657
def _get_all_permissions(opts):
    ""
    perms = []
    for action in settings.DEFAULT_PERMISSIONS:
        perms.append((_get_permission_codename(action, opts), 'Can %s %s' % (action, opts.verbose_name_raw)))
    return perms + list(opts.permissions)