docs: def get_weight(self, rule):
          """Get weight for rule.
  
          If rule is not in :attr:`R`, returns ``None``.
          """
          if not issubclass(rule.__class__, (Rule, RuleLeaf)):
              raise TypeError("Rule to get weight ({}) is not subclass "
                              "of {} or {}.".format(rule, Rule, RuleLeaf))
          try:
              ind = self._R.index(rule)
              return self._W[ind]
          except:
              return None