def get_user_and_orgs(user_token):
    """
    Retrieve the username and organizations associated with the provided user token.

    Args:
        user_token (str): The token used to authenticate the user. Must be a valid write token.

    Returns:
        list: A list containing the username followed by the organizations the user belongs to.

    Raises:
        Exception: If the user token is None or an empty string.
    """
    if user_token is None:
        raise Exception("Please login with a write token.")

    if user_token is None or len(user_token) == 0:
        raise Exception("Invalid token. Please login with a write token.")

    user_info = token_verification(token=user_token)
    username = user_info["name"]
    orgs = user_info["orgs"]

    who_is_training = [username] + orgs

    return who_is_training

    Retrieve the username and organizations associated with the provided user token.

    Args:
        user_token (str): The token used to authenticate the user. Must be a valid write token.

    Returns:
        list: A list containing the username followed by the organizations the user belongs to.

    Raises:
        Exception: If the user token is None or an empty string.
    
src/autotrain/app/utils.py