code: def _third_pass(wrappers):
      """What we do when there are not unique zs in a slice set"""
      inos = [s.instance_number for s in wrappers]
      msg_fmt = (
          "Plausibly matching slices, but where some have "
          "the same apparent slice location, and %s; "
          "- slices are probably unsortable"
      )
      if None in inos:
          raise DicomReadError(
              msg_fmt % "some or all slices with missing InstanceNumber"
          )
      if len(set(inos)) < len(inos):
          raise DicomReadError(
              msg_fmt
              % "some or all slices with the same InstanceNumber"
          )
      # sort by instance number
      wrappers.sort(key=_instance_sorter)
      # start loop, in which we start a new volume, each time we see a z
      # we've seen already in the current volume
      dw = wrappers[0]
      these_zs = [dw.slice_indicator]
      vol_list = [dw]
      out_vol_lists = [vol_list]
      for dw in wrappers[1:]:
          z = dw.slice_indicator
          if z not in these_zs:
              # same volume
              vol_list.append(dw)
              these_zs.append(z)
              continue
          # new volume
          vol_list.sort(_slice_sorter)
          vol_list = [dw]
          these_zs = [z]
          out_vol_lists.append(vol_list)
      vol_list.sort(_slice_sorter)
      return out_vol_lists
  
file_path: nibabel/nibabel/nicom/dicomreaders.py
imports: import glob
  from os.path import join
  import numpy
  from ..None import Nifti1Image
  from .dicomwrappers import wrapper_from_data, wrapper_from_file
label_desc: Use image node_id 7 for calling a global function with example usage: _third_pass(wrappers) and returns: out_vol_lists