def METHOD_NAME(self, key, value) -> None:
    if key is None:
        raise KeyError("attempting to assign env[None] = %r" % value)
    if value is None:
        raise ValueError("attempting to assign env[%s] = None" % key)
    # The `str` conversion is important to avoid triggering errors
    # with subprocess if we pass in a unicode value; see commentary
    # in the `_key` method.
    key = str(key)
    value = str(value)
    # The `unset` call is necessary on windows where the keys are
    # case insensitive.   Since this dict is case sensitive, simply
    # assigning the value to the new key is not sufficient to remove
    # the old value.  The `unset` call knows how to match keys and
    # remove any potential duplicates.
    self.unset(key)
    self._dict[key] = value