code: def __setitem__(self, key, value):
      if isinstance(value, dict) and not isinstance(
          value, self.value_type
      ):
          if isinstance(value, self.__class__):
              value = value.copy()
          else:
              value = self.__class__(value)
      if not isinstance(value, self.__class__) and not isinstance(
          value, self.value_type
      ):
          raise TensorforceError.type(
              name="NestedDict", argument="value", dtype=type(value)
          )
  
      if key is None or key == self.__class__._SINGLETON:
          assert super().__len__() == 0 or self.is_singleton()
          super().__setitem__(self.__class__._SINGLETON, value)
  
      elif not isinstance(key, str):
          raise TensorforceError.type(
              name="NestedDict", argument="key", dtype=type(key)
          )
  
      elif key.startswith(self.__class__._SINGLETON + "/"):
          raise TensorforceError.value(
              name="NestedDict", argument="key", value=key
          )
  
      elif self.is_singleton():
          self.singleton()[key] = value
  
      elif "/" in key:
          subvalue = value
          key, subkey = key.split("/", 1)
          if _is_keyword(x=key):
              raise TensorforceError.value(
                  name="NestedDict",
                  argument="key",
                  value=key,
                  hint="reserved keyword",
              )
          if super().__contains__(key):
              value = super().__getitem__(key)
          else:
              value = self.__class__()
              super(NestedDict, value).__setattr__(
                  "value_type", self.value_type
              )
              super(NestedDict, value).__setattr__(
                  "overwrite", self.overwrite
              )
          assert isinstance(value, self.__class__)
          value[subkey] = subvalue
          if not super().__contains__(key):
              # After setting subkey since setitem may modify value (TrackableNestedDict)
              self[key] = value
  
      else:
          if _is_keyword(x=key):
              raise TensorforceError.value(
                  name="NestedDict",
                  argument="key",
                  value=key,
                  hint="reserved keyword",
              )
          if not self.overwrite and super().__contains__(key):
              raise TensorforceError.value(
                  name="NestedDict",
                  argument="key",
                  value=key,
                  condition="already set",
              )
          super().__setitem__(key, value)
  
imports: from collections import OrderedDict
  from tensorforce import TensorforceError
label_desc: Use image node_id 15 for calling the NestedDict obj's underlying member method code with example usage: obj.__setitem__(key, value) without return types