def METHOD_NAME(cls, config):
    if config is None:
        return
    if not isinstance(config, dict):
        raise ValidationError('ICPC-styled contest expects no config or dict as config')
    for key, value in config.items():
        if key not in cls.config_defaults:
            raise ValidationError('unknown config key "%s"' % key)
        if not isinstance(value, type(cls.config_defaults[key])):
            raise ValidationError('invalid type for config key "%s"' % key)
        if not cls.config_validators[key](value):
            raise ValidationError('invalid value "%s" for config key "%s"' % (value, key))