def _is_option_provided(config, option, empty_value_is_valid=False):
    """
    Checks whether a parameter is provided in the config. If empty value is not valid then the option will be considered
    as not provided if no value is provided for the option.
    """

    if not config.has_configuration_option(option):
        return False
    elif (config.get_configuration_option(option) == '') and (empty_value_is_valid is False):
        return False
    return True