'Set the value of control by item labels.
value is expected to be an iterable of strings that are substrings of
the item labels that should be selected.  Before substring matching is
performed, the original label text is whitespace-compressed
(consecutive whitespace characters are converted to a single space
character) and leading and trailing whitespace is stripped.  Ambiguous
labels are accepted without complaint if the form\'s backwards_compat is
True; otherwise, it will not complain as long as all ambiguous labels
share the same item name (e.g. OPTION value).'

def set_value_by_label(self, value):

    if isstringlike(value):
        raise TypeError(value)
    if ((not self.multiple) and (len(value) > 1)):
        raise ItemCountError('single    selection    list,    must    set    sequence    of    length    0    or    1')
    items = []
    for nn in value:
        found = self.get_items(label=nn)
        if (len(found) > 1):
            if (not self._form.backwards_compat):
                opt_name = found[0].name
                if [o for o in found[1:] if (o.name != opt_name)]:
                    raise AmbiguityError(nn)
            else:
                found = found[:1]
        for o in found:
            if (self._form.backwards_compat or (o not in items)):
                items.append(o)
                break
        else:
            raise ItemNotFoundError(nn)
    self.value = []
    for o in items:
        o.selected = True
