def analyze(self, root_action_ref, link_tigger_ref):
        rules = Rule.query(trigger=link_tigger_ref, enabled=True)
        # pprint.pprint([rule.ref for rule in rules])
        for rule in rules:
            source_action_ref = self._get_source_action_ref(rule)
            if not source_action_ref:
                print 'No source_action_ref for rule %s' % rule.ref
                continue
            rule_links = self._rules.get(source_action_ref, None)
            if rule_links is None:
                rule_links = []
                self._rules[source_action_ref] = rule_links
            rule_links.append(RuleLink(source_action_ref=source_action_ref, rule_ref=rule.ref,
                                       dest_action_ref=rule.action.ref))
        analyzed = self._do_analyze(action_ref=root_action_ref)
        for (depth, rule_link) in analyzed:
            print ('  ' * depth, rule_link) % '%s%s'
        return analyzed
dataset/ETHPy150Open StackStorm/st2/tools/st2-analyze-links.py/LinksAnalyzer.analyze/swapped operands of `%`