def check_valid_config_space(config_space, parameters):
    """Check if the parameters is valid based on a configuration space

    Args:
        config_space (ConfigSpace): configuration space
        parameters (dict): parameters dictionary

    Raises:
        ValueError: If there is invalid values
    """
    base = config_space.get_default_configuration()
    for key, value in parameters.items():
        if key in base:
            base[key] = value
