def sort(index, reverse=False, limit=None, sort_type=None, raise_unsortable
    =True):
    """Return another IResultSet sorted using the ``index`` (an IIndexSort)
        passed to it after performing the sort using the index and the
        ``limit``, ``reverse``, and ``sort_type`` parameters.

        If ``sort_type`` is not ``None``, it should be the value
        :attr:`hypatia.interfaces.STABLE` to specify that the sort should be
        stable or :attr:`hypatia.interfaces.OPTIMAL` to specify that the sort
        algorithm chosen should be optimal (but not necessarily stable).  It's
        usually unnecessary to pass this value, even if you're resorting an
        already-sorted set of docids, because the implementation of IResultSet
        will internally ensure that subsequent sorts of the returned result set
        of an initial sort will be stable; if you don't want this behavior,
        explicitly pass :attr:`hypatia.interfaces.OPTIMAL` on the second and
        subsequent sorts of a set of docids.

        If ``raise_unsortable`` is ``True`` (the default), if the index cannot
        resolve any of the docids in the set of docids in this result set, a
        :exc:`hypatia.exc.Unsortable` exception will be raised during iteration
        over the sorted docids.
        """
