code: def slice_split(
      index: Union[int, slice], sizes: List[int]
  ) -> Dict[int, Union[int, slice]]:
      size = sum(sizes)
  
      if isinstance(index, Integral):
          index = index if index >= 0 else size + index
          i = 0
          ind = index
          lens = list(sizes)
          while ind >= lens[0]:
              i += 1
              ind -= lens.pop(0)
          return {i: ind}
  
      assert isinstance(index, slice)
      start, stop, step = index.indices(size)
  
      slice_all = slice(None)
  
      if index == slice_all:
          return dict((k, slice_all) for k in range(len(sizes)))
  
      d = dict()
      if step > 0:
          for i, length in enumerate(sizes):
              if start < length and stop > 0:
                  d[i] = slice(start, min(stop, length), step)
                  start = (start - length) % step
              else:
                  start = start - length
              stop -= length
      else:
          rstart = start  # running start
          chunk_boundaries = np.cumsum(sizes)
          for i, chunk_stop in reversed(
              list(enumerate(chunk_boundaries))
          ):
              # create a chunk start and stop
              if i == 0:
                  chunk_start = 0
              else:
                  chunk_start = chunk_boundaries[i - 1]
  
              # if our slice is in this chunk
              if (chunk_start <= rstart < chunk_stop) and (
                  rstart > stop
              ):
                  d[i] = slice(
                      rstart - chunk_stop,
                      max(
                          chunk_start - chunk_stop - 1,
                          stop - chunk_stop,
                      ),
                      step,
                  )
  
                  # compute the next running start point,
                  offset = (rstart - (chunk_start - 1)) % step
                  rstart = chunk_start + offset - 1
  
      # replace 0:20:1 with : if appropriate
      for k, v in d.items():
          if v == slice(0, sizes[k], 1):
              d[k] = slice(None, None, None)
  
      if not d:  # special case x[:0]
          d[0] = slice(0, 0, 1)
  
      return d
  
imports: import inspect
  import itertools
  import operator
  from collections import OrderedDict
  from collections.abc import Iterable
  from functools import lru_cache, reduce, wraps
  from math import ceil
  from numbers import Integral
  from typing import Dict, List, Union
  import numpy
  from ..core import ExecutableTuple, recursive_tile
  from ..utils import lazy_import
  from ..lib.mmh3 import hash_from_buffer
label_desc: Use image node_id 15 for calling a global function with example usage: slice_split(index, sizes) and returns: d, dict, dict