def get_children(self, test, expression): """ Find all children matching a TextMatch rule and return them. """ matching_children = list() for child in self.children: if TextMatch.dict_call(test, child.text, expression): matching_children.append(child) return matching_children
def _lineage_eval_text_match_rules(rules, text): """ Evaluate a list of lineage text_match rules. Only one text_match rule must match in order to return True """ for rule in rules: if TextMatch.dict_call(rule['test'], text, rule['expression']): return True return False