nodes: 0, module; 1, function_definition; 2, function_name:is_sorted; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, identifier:ranks; 11, None; 12, comment:"""
          Checks whether the stack is sorted.
  
          :arg dict ranks:
              The rank dict to reference for checking. If ``None``, it will
              default to ``DEFAULT_RANKS``.
  
          :returns:
              Whether or not the cards are sorted.
  
          """; 13, assignment; 14, call; 15, identifier:ranks; 16, boolean_operator; 17, identifier:check_sorted; 18, argument_list; 19, identifier:ranks; 20, attribute; 21, identifier:self; 22, identifier:ranks; 23, identifier:self; 24, identifier:ranks
code: def is_sorted(self, ranks=None):
          """
          Checks whether the stack is sorted.
  
          :arg dict ranks:
              The rank dict to reference for checking. If ``None``, it will
              default to ``DEFAULT_RANKS``.
  
          :returns:
              Whether or not the cards are sorted.
  
          """
          ranks = ranks or self.ranks
  
          return check_sorted(self, ranks)