'Returns a sort_instruction and paging operator.
Sort instructions are used in the query to determine what attributes
to sort on and what direction to use.
:param sort_keys: array of attributes by which results be sorted.
:param sort_dir: direction in which results be sorted (asc, desc).
:return: sort instructions and paging operator'

@classmethod
def _build_sort_instructions(cls, sort_keys=None, sort_dir='desc'):

    sort_keys = (sort_keys or [])
    sort_instructions = []
    (_sort_dir, operation) = cls.SORT_OPERATION_MAPPING.get(sort_dir, cls.SORT_OPERATION_MAPPING['desc'])
    for _sort_key in sort_keys:
        _instruction = (_sort_key, _sort_dir)
        sort_instructions.append(_instruction)
    return (sort_instructions, operation)
