Get a configuration value, using fallback for missing values.

    Parameters:
    config   -- the configparser to try to extract the option value from.
    section  -- the section to extract value from.
    option   -- the name of the option to extract value from.
    fallback -- fallback value to return if no value was set in `config`.

    returns  -- the config option value if it was set, else fallback.

def _get_with_fallback(config, section, option, fallback):
    """Get a configuration value, using fallback for missing values.

    Parameters:
    config   -- the configparser to try to extract the option value from.
    section  -- the section to extract value from.
    option   -- the name of the option to extract value from.
    fallback -- fallback value to return if no value was set in `config`.

    returns  -- the config option value if it was set, else fallback.

    """
    exists = (config.has_section(section)
              and config.has_option(section, option))

    if not exists:
        return fallback
    else:
        return config.get(section, option)