def set_config_var(from_file, from_env, default):
    """
    Set a configuration value based on the hierarchy of:
        default => file => env

    :param from_file: value from the configuration file
    :param from_env: value from the environment
    :param default: default configuration value
    :return: value to use as configuration
    """

    if from_env is not None:
        return from_env
    elif from_file is not None:
        return from_file
    else:
        return default