docs: def get_rule(self, template_name):
          """Find a matching compilation rule for a function.
  
          Raises a :exc:`ValueError` if no matching rule can be found.
  
          :param template_name: the name of the template
          """
          for regex, render_func in self.rules:
              if re.match(regex, template_name):
                  return render_func
          raise ValueError("no matching rule")