<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)