code: def delete_item(self, key: InstanceKey) -> "InstanceNode":
          
          if not isinstance(self.value, StructuredValue):
              raise InstanceValueError(self.json_pointer(), "scalar value")
          newval = self.value.copy()
          try:
              del newval[key]
          except (KeyError, IndexError, TypeError):
              raise NonexistentInstance(self.json_pointer(),
                                        f"item '{key}'") from None
          return self._copy(newval)
docs: Delete an item (member or entry) from receiver's value.
  
          Args:
              key: Key of the item (instance name or index).
  
          Raises:
              NonexistentInstance: If receiver's value doesn't contain the item.
              InstanceValueError: If the receiver's value is a scalar.