def cast_to_list(data):
    """Cast data to a list if it is not already a list.

    :param data: The variable to be cast to a list.
    :return: The data in a list
    """
    if not isinstance(data, list):
        data = [data]
    return data