(cls, db, list_to_order, order_by, direction)
:param list_to_order:
        :param order_by:
        :param direction:
        :return:

        Sort the given list in redis.
        https://redis.io/commands/sort#using-hashes-in-codebycode-and-codegetcode
async def _get_ordered_result(cls, db, list_to_order, order_by, direction):
        """

        :param list_to_order:
        :param order_by:
        :param direction:
        :return:

        Sort the given list in redis.
        https://redis.io/commands/sort#using-hashes-in-codebycode-and-codegetcode
        """
        pairs = []
        for x in list_to_order:
            pairs.extend([0, x])
        if pairs:
            ordered_res_key = 'filtered_result-{}'.format(uuid.uuid1())
            await db.zadd(ordered_res_key, pairs[0], pairs[1], *pairs[2:])
            ordered_result = await db.sort(
                ordered_res_key,
                by='{}:*->{}'.format(cls.__name__, order_by),
                alpha=True,
                asc=direction
            )
            # Delete the temp store
            await db.delete(ordered_res_key)
            return ordered_result
        else:
            return []
async def _get_ordered_result ( cls , db , list_to_order , order_by , direction ) : pairs = [ ] for x in list_to_order : pairs . extend ( [ 0 , x ] ) if pairs : ordered_res_key = 'filtered_result-{}' . format ( uuid . uuid1 ( ) ) await db . zadd ( ordered_res_key , pairs [ 0 ] , pairs [ 1 ] , * pairs [ 2 : ] ) ordered_result = await db . sort ( ordered_res_key , by = '{}:*->{}' . format ( cls . __name__ , order_by ) , alpha = True , asc = direction ) # Delete the temp store await db . delete ( ordered_res_key ) return ordered_result else : return [ ]