retrive match action and subject

def relevant_rules_for_match(self, action, subject):
        """retrive match action and subject"""
        matches = []
        for rule in self.rules:
            rule.expanded_actions = self.expand_actions(rule.actions)
            if rule.is_relevant(action, subject):
                matches.append(rule)

        return self.optimize(matches[::-1])