code: def _get_combined_index(indexes, intersect: bool = False, sort=None):
      if len(indexes) == 0:
          index = cudf.Index([])
      elif len(indexes) == 1:
          index = indexes[0]
      elif intersect:
          sort = True
          index = indexes[0]
          for other in indexes[1:]:
              # Don't sort for every intersection,
              # let the sorting happen in the end.
              index = index.intersection(other, sort=False)
      else:
          index = indexes[0]
          if sort is None:
              sort = not isinstance(index, cudf.StringIndex)
          for other in indexes[1:]:
              index = index.union(other, sort=False)
  
      if sort:
          if not index.is_monotonic_increasing:
              index = index.sort_values()
  
      return index
  
imports: import itertools
  import warnings
  from collections import abc
  from typing import Dict, Optional
  import cupy
  import numpy
  import pandas
  import cudf
  from cudf._lib.transform import one_hot_encode
  from cudf._lib.types import size_type_dtype
  from cudf._typing import Dtype
  from cudf.api.extensions import no_default
  from cudf.core.column import ColumnBase, as_column, column_empty_like
  from cudf.core.column.categorical import CategoricalColumn
  from cudf.utils.dtypes import min_unsigned_type
label_desc: Use image node_id 2 for calling a global function with example usage: _get_combined_index(indexes, intersect, sort) and returns: index