code: def pop(self, key, default=None):
      if key is None or key == self.__class__._SINGLETON:
          assert super().__len__() == 0 or self.is_singleton()
          if super().__contains__(self.__class__._SINGLETON):
              value = super().__getitem__(self.__class__._SINGLETON)
              super().__delitem__(self.__class__._SINGLETON)
          else:
              value = default
          return 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():
          value = self.singleton()
          if isinstance(value, self.value_type):
              return default
          else:
              return value.pop(key, default=default)
  
      elif "/" in key:
          key, subkey = key.split("/", 1)
          if super().__contains__(key):
              value = super().__getitem__(key)
              assert isinstance(value, self.__class__)
              return value.pop(subkey, default)
          else:
              return default
  
      else:
          # TODO: can't use pop since __delitem__ not implemented
          if super().__contains__(key):
              value = super().__getitem__(key)
              super().__delitem__(key)
              return value
          else:
              return default
  
imports: from collections import OrderedDict
  from tensorforce import TensorforceError
label_desc: Use image node_id 22 for calling the NestedDict obj's underlying member method code with example usage: obj.pop(key, default) and returns: value, default, value, value, default, value, default