code: def _iter_coords(nsls):
      
      # First convert all slices to ranges
      ranges = list()
      for nsl in nsls:
          if isinstance(nsl, int):
              ranges.append(range(nsl, nsl+1))
          else:
              ranges.append(range(nsl.start, nsl.stop))
      # Iterate through all matching coordinates
      yield from itertools.product(*ranges)
docs: Iterate through all matching coordinates in a sequence of slices.