code: def _get_combined_index(indexes, intersect=False, sort=False):
      """
      Return the union or intersection of indexes.
  
      Parameters
      ----------
      indexes : list of Index or list objects
          When intersect=True, do not accept list of lists.
      intersect : bool, default False
          If True, calculate the intersection between indexes. Otherwise,
          calculate the union.
      sort : bool, default False
          Whether the result index should come out sorted or not.
  
      Returns
      -------
      Index
      """
  
      # TODO: handle index names!
      indexes = _get_distinct_objs(indexes)
      if len(indexes) == 0:
          index = Index([])
      elif len(indexes) == 1:
          index = indexes[0]
      elif intersect:
          index = indexes[0]
          for other in indexes[1:]:
              index = index.intersection(other)
      else:
          index = _union_indexes(indexes, sort=sort)
          index = ensure_index(index)
  
      if sort:
          try:
              index = index.sort_values()
          except TypeError:
              pass
      return index
  
imports: import textwrap
  import warnings
  from pandas._libs import NaT, lib
  import pandas.core.common
  from pandas.core.indexes.base import Index, _new_Index, ensure_index, ensure_index_from_sequences
  from pandas.core.indexes.base import InvalidIndexError
  from pandas.core.indexes.category import CategoricalIndex
  from pandas.core.indexes.datetimes import DatetimeIndex
  from pandas.core.indexes.interval import IntervalIndex
  from pandas.core.indexes.multi import MultiIndex
  from pandas.core.indexes.numeric import Float64Index, Int64Index, NumericIndex, UInt64Index
  from pandas.core.indexes.period import PeriodIndex
  from pandas.core.indexes.range import RangeIndex
  from pandas.core.indexes.timedeltas import TimedeltaIndex
label_desc: Use image node_id 3 for calling a global function with example usage: _get_combined_index(indexes, intersect, sort) and returns: index