def sort(self, key, by=None, get=None, start=None, num=None, desc=False,
             alpha=False):
        stmt = ['SORT', key]
        if by:
            stmt.extend(['BY', by])
        if start and num:
            stmt.extend(['LIMIT', start, num])
        if get is None:
            pass
        elif isinstance(get, basestring):
            stmt.extend(['GET', get])
        elif isinstance(get, list) or isinstance(get, tuple):
            for g in get:
                stmt.extend(['GET', g])
        else:
            raise exceptions.RedisError(
                "Invalid parameter 'get' for Redis sort")
        if desc:
            stmt.append("DESC")
        if alpha:
            stmt.append("ALPHA")
        self._send(*stmt)
        return self.getResponse()
Sort the elements in a list, set or sorted set
dataset/ETHPy150Open deldotdr/txRedis/txredis/client.py/RedisClient.sort