code: def parse_ellipsis(index):
      """
      Helper to split a slice into parts left and right of Ellipses.
  
      :param index: A tuple, or other object (None, int, slice, Funsor).
      :returns: a pair of tuples ``left, right``.
      :rtype: tuple
      """
      if not isinstance(index, tuple):
          index = (index,)
      left = []
      i = 0
      for part in index:
          i += 1
          if part is Ellipsis:
              break
          left.append(part)
      right = []
      for part in reversed(index[i:]):
          if part is Ellipsis:
              break
          right.append(part)
      right.reverse()
      return tuple(left), tuple(right)
  
imports: import math
  import operator
  from numbers import Number
  from .op import BINARY_INVERSES, DISTRIBUTIVE_OPS, PRODUCT_TO_POWER, SAFE_BINARY_INVERSES, UNARY_INVERSES, UNITS, BinaryOp, Op, OpMeta, TransformOp, UnaryOp, declare_op_types
label_desc: Use image node_id 4 for calling a global function with example usage: parse_ellipsis(index) and returns: tuple,  tuple