nodes: 0, module; 1, function_definition; 2, function_name:subclasses; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, identifier:sort_by; 13, None; 14, identifier:reverse; 15, False; 16, comment:"""Get all nested Constant class instance and it's name pair.
  
          :param sort_by: the attribute name used for sorting.
          :param reverse: if True, return in descend order.
          :returns: [(attr, value),...] pairs.
  
          ::
  
              >>> class MyClass(Constant):
              ...     a = 1 # non-class attributre
              ...     b = 2 # non-class attributre
              ...
              ...     class C(Constant):
              ...         pass
              ...
              ...     class D(Constant):
              ...         pass
  
              >>> my_class = MyClass()
              >>> my_class.subclasses()
              [("C", my_class.C), ("D", my_class.D)]
  
          .. versionadded:: 0.0.4
          """; 17, assignment; 18, pattern_list; 19, call; 20, block; 21, identifier:l; 22, identifier:l; 23, call; 24, identifier:attr; 25, identifier:_; 26, attribute; 27, argument_list; 28, expression_statement; 29, expression_statement; 30, identifier:list; 31, argument_list; 32, identifier:self; 33, identifier:Subclasses; 34, identifier:sort_by; 35, identifier:reverse; 36, assignment; 37, call; 38, identifier:value; 39, call; 40, attribute; 41, argument_list; 42, identifier:getattr; 43, argument_list; 44, identifier:l; 45, identifier:append; 46, tuple; 47, identifier:self; 48, identifier:attr; 49, identifier:attr; 50, identifier:value
code: def subclasses(self, sort_by=None, reverse=False):
          """Get all nested Constant class instance and it's name pair.
  
          :param sort_by: the attribute name used for sorting.
          :param reverse: if True, return in descend order.
          :returns: [(attr, value),...] pairs.
  
          ::
  
              >>> class MyClass(Constant):
              ...     a = 1 # non-class attributre
              ...     b = 2 # non-class attributre
              ...
              ...     class C(Constant):
              ...         pass
              ...
              ...     class D(Constant):
              ...         pass
  
              >>> my_class = MyClass()
              >>> my_class.subclasses()
              [("C", my_class.C), ("D", my_class.D)]
  
          .. versionadded:: 0.0.4
          """
          l = list()
          for attr, _ in self.Subclasses(sort_by, reverse):
              value = getattr(self, attr)
              l.append((attr, value))
          return l