import re


def __get_direction(directions):
    """
    Creates a sorted list showing which directions the user asked for. Ex: 'xyz' -> ['x', 'y', 'z']

    Args:
        directions (str):
            A string containing the directions the user wants to process (Ex: 'xyz', 'zy', 'x')

    Returns:
        list(str): An ordered list that simplifies the user input for future processing

    """
    if not (bool(re.match('^[xyz]+$',directions))
            or len(directions) > 3
            or len(directions) == 0):
        raise ValueError('Invalid directions used.')
    return sorted(list(set(directions)))