def get_rule_by_name(self, rule_name):
        """Gets a rule given its name."""
        try:
            return next(
                r for r in self.rules if r.__name__ == rule_name)
        except __HOLE__:
            raise Exception('Could not find rule with name %s' % rule_name)
dataset/ETHPy150Open oppia/oppia/extensions/interactions/base.py/BaseInteraction.get_rule_by_name