code: def rules(cls, attr=None):
          
          try:
              if attr is None:
                  attr = cls._rules_attr()
              return getattr(cls, attr).keys()
          except TypeError:
              return ()
docs: Iterable of rule names used by :meth:`create`
  
          Args:
              attr (None or str): Name of the class attribute to which to get the
                  names. If None, one of ``'_rules'``, ``'_binary_rules'`` is
                  automatically chosen