nodes: 0, module; 1, function_definition; 2, function_name:Subclasses; 3, parameters; 4, block; 5, identifier:cls; 6, default_parameter; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, if_statement; 12, expression_statement; 13, return_statement; 14, identifier:sort_by; 15, None; 16, identifier:reverse; 17, False; 18, comment:"""Get all nested Constant class 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
  
          >>> MyClass.Subclasses()
          [("C", MyClass.C), ("D", MyClass.D)]
  
          .. versionadded:: 0.0.3
          """; 19, assignment; 20, pattern_list; 21, call; 22, block; 23, comparison_operator:sort_by is None; 24, block; 25, assignment; 26, identifier:l; 27, identifier:l; 28, call; 29, identifier:attr; 30, identifier:value; 31, identifier:get_all_attributes; 32, argument_list; 33, try_statement; 34, identifier:sort_by; 35, None; 36, expression_statement; 37, identifier:l; 38, call; 39, identifier:list; 40, argument_list; 41, identifier:cls; 42, block; 43, except_clause; 44, assignment; 45, identifier:list; 46, argument_list; 47, if_statement; 48, block; 49, identifier:sort_by; 50, string:"__creation_index__"; 51, call; 52, call; 53, block; 54, pass_statement; 55, identifier:sorted; 56, argument_list; 57, identifier:issubclass; 58, argument_list; 59, expression_statement; 60, identifier:l; 61, keyword_argument; 62, keyword_argument; 63, identifier:value; 64, identifier:Constant; 65, call; 66, identifier:key; 67, lambda; 68, identifier:reverse; 69, identifier:reverse; 70, attribute; 71, argument_list; 72, lambda_parameters; 73, call; 74, identifier:l; 75, identifier:append; 76, tuple; 77, identifier:x; 78, identifier:getattr; 79, argument_list; 80, identifier:attr; 81, identifier:value; 82, subscript; 83, identifier:sort_by; 84, identifier:x; 85, integer:1
code: def Subclasses(cls, sort_by=None, reverse=False):
          """Get all nested Constant class 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
  
          >>> MyClass.Subclasses()
          [("C", MyClass.C), ("D", MyClass.D)]
  
          .. versionadded:: 0.0.3
          """
          l = list()
          for attr, value in get_all_attributes(cls):
              try:
                  if issubclass(value, Constant):
                      l.append((attr, value))
              except:
                  pass
  
          if sort_by is None:
              sort_by = "__creation_index__"
  
          l = list(
              sorted(l, key=lambda x: getattr(x[1], sort_by), reverse=reverse))
  
          return l