human
I wrote the below code

    def wrap(self, name, value):
        paramcache = self.cache_choiceparams(name)
        old = self.get(name)
        f(self, name, value)
        if (not self.hasValidValue(name)):
            self._trch_set(name, old)
            raise exception.CmdErr, ('Invalid    value    for    %s    (%s)' % (name, value))
        for param in paramcache:
            if (param.name in util.iDict(self.cache_choiceparams(name))):
                try:
                    if (not self.getParameter(param.name).isHidden()):
                        self.set(*param)
                except (exception.CmdErr, AttributeError):
                    pass
    return wrap

What's a good function header?
assistant
#Here's a good function header.

def safesetchoice(f):