Exemple #1
0
      },
      ...
  }

  """

    # pylint: disable=too-few-public-methods

    def __init__(self, rule_list):
        self.rules = dict()

        for parents, fstdeg, snddeg in rule_list:
            for parent in parents:
                self.rules[parent] = {"fst": fstdeg, "snd": snddeg}


DEFAULT_RULE_LIST = [[{"Audit"}, {Attr("program")}, Types.all - Types.ignore]]


def get_rules(rule_list=None):
    """Get the rules governing the snapshot creation

  Args:
    rule_list: List of rules
  Returns:
    Rules object with attribute `rules`. See Rules object for detailed doc.
  """
    if not rule_list:
        rule_list = DEFAULT_RULE_LIST
    return Rules(rule_list)