code: def _handle_result_by_idx_slice(self, idx_slice):
          
          opts = dict(self.options)
          skip = opts.pop('skip', 0)
          limit = opts.pop('limit', None)
          py_to_couch_validate('skip', skip)
          py_to_couch_validate('limit', limit)
          start = idx_slice.start
          stop = idx_slice.stop
          data = None
          # start and stop cannot be None and both must be greater than 0
          if all(i is not None and i >= 0 for i in [start, stop]) and start < stop:
              if limit is not None:
                  if start >= limit:
                      # Result is out of range
                      return dict()
                  if stop > limit:
                      # Ensure that slice does not extend past original limit
                      return self._ref(skip=skip+start, limit=limit-start, **opts)
              data = self._ref(skip=skip+start, limit=stop-start, **opts)
          elif start is not None and stop is None and start >= 0:
              if limit is not None:
                  if start >= limit:
                      # Result is out of range
                      return dict()
                  # Ensure that slice does not extend past original limit
                  data = self._ref(skip=skip+start, limit=limit-start, **opts)
              else:
                  data = self._ref(skip=skip+start, **opts)
          elif start is None and stop is not None and stop >= 0:
              if limit is not None and stop > limit:
                  # Ensure that slice does not extend past original limit
                  data = self._ref(skip=skip, limit=limit, **opts)
              else:
                  data = self._ref(skip=skip, limit=stop, **opts)
          return data
docs: Handle processing when the result argument provided is an index slice.