nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, identifier:ranks; 11, None; 12, comment:"""
          Sorts the stack, either by poker ranks, or big two ranks.
  
          :arg dict ranks:
              The rank dict to reference for sorting. If ``None``, it will
              default to ``DEFAULT_RANKS``.
  
          :returns:
              The sorted cards.
  
          """; 13, assignment; 14, assignment; 15, identifier:ranks; 16, boolean_operator; 17, attribute; 18, call; 19, identifier:ranks; 20, attribute; 21, identifier:self; 22, identifier:cards; 23, identifier:sort_cards; 24, argument_list; 25, identifier:self; 26, identifier:ranks; 27, attribute; 28, identifier:ranks; 29, identifier:self; 30, identifier:cards
code: def sort(self, ranks=None):
          """
          Sorts the stack, either by poker ranks, or big two ranks.
  
          :arg dict ranks:
              The rank dict to reference for sorting. If ``None``, it will
              default to ``DEFAULT_RANKS``.
  
          :returns:
              The sorted cards.
  
          """
          ranks = ranks or self.ranks
          self.cards = sort_cards(self.cards, ranks)