code: def _parse_slices(index, value):
      if not isinstance(index, tuple):
          index = (index,)
      if index[0] is Ellipsis:
          index = index[1:]
      start_stops = []
      for pos, i in reversed(list(enumerate(index))):
          if isinstance(i, slice):
              start_stops.append((i.start, i.stop))
          elif isinstance(i, int):
              start_stops.append((i, i + 1))
              value = ops.unsqueeze(value, pos - len(index))
          else:
              raise ValueError("invalid index: {}".format(i))
      start_stops.reverse()
      return start_stops, value
  
imports: import math
  from collections import OrderedDict, defaultdict
  from contextlib import contextmanager
  from functools import reduce
  import funsor.ops
  from funsor.affine import affine_inputs, extract_affine, is_affine
  from funsor.delta import Delta
  from funsor.domains import Real, Reals
  from funsor.interpretations import compress_gaussians
  from funsor.ops import AddOp, SubOp
  from funsor.tensor import Tensor, align_tensor, align_tensors
  from funsor.terms import Binary, Funsor, FunsorMeta, Number, Slice, Subs, Variable, eager, reflect
  from funsor.util import broadcast_shape, get_tracing_state, lazy_property
label_desc: Use image node_id 13 for calling a global function with example usage: _parse_slices(index, value) and returns: start_stops,  value