code: def sort(self, ranks=None):
          
          ranks = ranks or self.ranks
          self.cards = sort_cards(self.cards, ranks)
docs: 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.