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 validate_slice(self, slice_, as_range=False):
      if not (slice_.step is None or slice_.step == 1):
          raise ValueError("slicing with step is unsupported")
      length = len(self)
      if slice_.start is None:
          start = 0
      elif slice_.start < 0:
          start = length + slice_.start
      else:
          start = slice_.start
      start = min(length, start)
      if slice_.stop is None:
          stop = 0
      elif slice_.stop < 0:
          stop = length + slice_.stop
      else:
          stop = slice_.stop
      stop = min(length, stop or length)
      return (
          xrange(start, stop) if as_range else slice(start, stop, None)
      )
  
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 7 for calling the Sequence obj's underlying member method code with example usage: obj.validate_slice(slice_, as_range) and returns: unknown