def collect_rules_and_groups()

in visualize_rules_graph.py [0:0]


def collect_rules_and_groups(rules_toml_dict):
    """
    Collects rules and groups to further build graph nodes.

    Rules belonging to a group different than `Cleanup Rule` are displayed below the group name.

    Cleanup Rule's are added to a set as they are displayed differently.
        They get an additional label `(Cleanup_Rule)`.

    Nodes without a group are added to a different set.
    """
    for rule_toml in rules_toml_dict['rules']:
        rule_name: str = sanitize_name(rule_toml['name'])
        if 'query' not in rule_toml:
            dummy_nodes.add(rule_name)

        if 'groups' in rule_toml:
            rule_groups = rule_toml['groups']
            collect_node_for_rule_with_group(rule_name, rule_groups)
        else:
            nodes_without_groups.add(rule_name)