class_docstr: The list-like object that contains every :class:`SingleImage`
  in the :class:`~wand.image.Image` container.  It implements
  :class:`collections.abc.Sequence` protocol.
  
  .. versionadded:: 0.3.0
class_docstr_tok: ["The","list-like","object","that","contains","every",":","class",":","`","SingleImage","`","in","the",":","class",":","`","~wand.image.Image","`","container",".","It","implements",":","class",":","`","collections.abc.Sequence","`","protocol",".","..","versionadded",":",":","0.3.0"]
code: def __setitem__(self, index, image):
      if isinstance(index, slice):
          tmp_idx = self.current_index
          slice_ = self.validate_slice(index)
          del self[slice_]
          self.extend(image, offset=slice_.start)
          self.current_index = tmp_idx
      else:
          if not isinstance(image, BaseImage):
              raise TypeError(
                  "image must be an instance of wand.image."
                  "BaseImage, not " + repr(image)
              )
          with self.index_context(index) as index:
              if library.MagickHasNextImage(self.image.wand):
                  library.MagickAddImage(self.image.wand, image.wand)
                  library.MagickRemoveImage(self.image.wand)
              else:
                  library.MagickRemoveImage(self.image.wand)
                  library.MagickAddImage(self.image.wand, image.wand)
  
imports: import contextlib
  import ctypes
  import numbers
  from .api import libmagick, library
  from .compat import abc, binary, xrange
  from .image import BaseImage, ImageProperty
  from .version import MAGICK_VERSION_INFO
label_desc: Use image node_id 9 for calling the Sequence obj's underlying member method code with example usage: obj.__setitem__(index, image) without return types