def validate(method):
<EOL>name_error = '<STR_LIT>'<EOL>@functools.wraps(method)<EOL>def validator(self, name, *args):<EOL><INDENT>if name not in self.allowed_opts:<EOL><INDENT>raise ValueError(name_error.format(name))<EOL><DEDENT>return method(self, name, *args)<EOL><DEDENT>return validator<EOL>
Config option name value validator decorator.