code: def get_any_nt_unit_rule(g):
      
      for rule in g.rules:
          if len(rule.rhs) == 1 and isinstance(rule.rhs[0], NT):
              return rule
      return None
docs: Returns a non-terminal unit rule from 'g', or None if there is none.