def data_checker(task_name):
    """
    Verify if a task associated to a dataset is valid in maxsmi.

    Parameters
    ----------
    task_name : str
        The considered physical chemical task.

    Returns
    -------
    bool :
        True if the name is valid. Raises an error otherwise.
    """
    if task_name in ["FreeSolv", "ESOL", "lipophilicity", "affinity"]:
        return task_name
    else:
        raise NameError(
            "The task is unknown. Please choose between 'FreeSolv', 'ESOL', 'lipophilicity' and 'affinity'. \
                Program aborting."
        )