def _resolve_input(variable, variable_name, config_key, config):
    """
    Resolve input entered as option values with config values

    If option values are provided (passed in as `variable`), then they are
     returned unchanged. If `variable` is None, then we first look for a config
     value to use.
    If no config value is found, then raise an error.

    Parameters
    ----------
    variable: string or numeric
        value passed in as input by the user
    variable_name: string
        name of the variable, for clarity in the error message
    config_key: string
        key in the config whose value could be used to fill in the variable
    config: ConfigParser
        contains keys/values in .apparatecfg
    """
    if variable is None:
        try:
            variable = config.get(PROFILE, config_key)
        except NoOptionError:
            raise ValueError((
                'no {} found - either provide a command line argument or '
                'set up a default by running `apparate configure`'
            ).format(variable_name))
    return variable
Resolve input entered as option values with config values

    If option values are provided (passed in as `variable`), then they are
     returned unchanged. If `variable` is None, then we first look for a config
     value to use.
    If no config value is found, then raise an error.

    Parameters
    ----------
    variable: string or numeric
        value passed in as input by the user
    variable_name: string
        name of the variable, for clarity in the error message
    config_key: string
        key in the config whose value could be used to fill in the variable
    config: ConfigParser
        contains keys/values in .apparatecfg