code: def is_sorted(self, ranks=None):
          
          ranks = ranks or self.ranks
  
          return check_sorted(self, ranks)
docs: 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.