'Sets one of the bits based on a name from the _map
:param key:
The unicode string of one of the bit names
:param value:
A boolean value
:raises:
ValueError - when _map is not set or the key name is invalid'

def __setitem__(self, key, value):

    is_int = isinstance(key, int_types)
    if (not is_int):
        if (self._map is None):
            raise ValueError(unwrap(u'\n                                                                                %s._map    has    not    been    defined\n                                                                                ', type_name(self)))
        if (key not in self._reverse_map):
            raise ValueError(unwrap(u'\n                                                                                %s._map    does    not    contain    an    entry    for    "%s"\n                                                                                ', type_name(self), key))
    if (self._native is None):
        self.native
    if (self._map is None):
        new_native = list(self._native)
        max_key = (len(new_native) - 1)
        if (key > max_key):
            new_native.extend(([0] * (key - max_key)))
        new_native[key] = (1 if value else 0)
        self._native = tuple(new_native)
    else:
        if is_int:
            key = self._map.get(key, key)
        if value:
            if (key not in self._native):
                self._native.add(key)
        elif (key in self._native):
            self._native.remove(key)
    self.set(self._native)
