'Set value of control.
If only name and value arguments are supplied, equivalent to
form[name] = value'

def set_value(self, value, name=None, type=None, kind=None, id=None, nr=None, by_label=False, label=None):

    if by_label:
        deprecation('form.get_value_by_label(...)')
    c = self.find_control(name, type, kind, id, label=label, nr=nr)
    if by_label:
        try:
            meth = c.set_value_by_label
        except AttributeError:
            raise NotImplementedError(("control    '%s'    does    not    yet    support    by_label" % c.name))
        else:
            meth(value)
    else:
        c.value = value
