class_docstr: pandas-on-Spark MultiIndex that corresponds to pandas MultiIndex logically. This might hold
  Spark Column internally.
  
  Parameters
  ----------
  levels : sequence of arrays
      The unique labels for each level.
  codes : sequence of arrays
      Integers for each level designating which label at each location.
  sortorder : optional int
      Level of sortedness (must be lexicographically sorted by that
      level).
  names : optional sequence of objects
      Names for each of the index levels. (name is accepted for compat).
  copy : bool, default False
      Copy the meta-data.
  verify_integrity : bool, default True
      Check that the levels/codes are consistent and valid.
  
  See Also
  --------
  MultiIndex.from_arrays  : Convert list of arrays to MultiIndex.
  MultiIndex.from_product : Create a MultiIndex from the cartesian product
                            of iterables.
  MultiIndex.from_tuples  : Convert list of tuples to a MultiIndex.
  MultiIndex.from_frame   : Make a MultiIndex from a DataFrame.
  Index : A single-level Index.
  
  Examples
  --------
  >>> ps.DataFrame({'a': ['a', 'b', 'c']}, index=[[1, 2, 3], [4, 5, 6]]).index  # doctest: +SKIP
  MultiIndex([(1, 4),
              (2, 5),
              (3, 6)],
             )
  
  >>> ps.DataFrame({'a': [1, 2, 3]}, index=[list('abc'), list('def')]).index  # doctest: +SKIP
  MultiIndex([('a', 'd'),
              ('b', 'e'),
              ('c', 'f')],
             )
class_docstr_tok: ["pandas-on-Spark","MultiIndex","that","corresponds","to","pandas","MultiIndex","logically",".","This","might","hold","Spark","Column","internally",".","Parameters","--","--","--","--","--","levels",":","sequence","of","arrays","The","unique","labels","for","each","level",".","codes",":","sequence","of","arrays","Integers","for","each","level","designating","which","label","at","each","location",".","sortorder",":","optional","int","Level","of","sortedness","(","must","be","lexicographically","sorted","by","that","level",")",".","names",":","optional","sequence","of","objects","Names","for","each","of","the","index","levels",".","(","name","is","accepted","for","compat",")",".","copy",":","bool",",","default","False","Copy","the","meta-data",".","verify_integrity",":","bool",",","default","True","Check","that","the","levels\/codes","are","consistent","and","valid",".","See","Also","--","--","--","--","MultiIndex.from_arrays",":","Convert","list","of","arrays","to","MultiIndex",".","MultiIndex.from_product",":","Create","a","MultiIndex","from","the","cartesian","product","of","iterables",".","MultiIndex.from_tuples",":","Convert","list","of","tuples","to","a","MultiIndex",".","MultiIndex.from_frame",":","Make","a","MultiIndex","from","a","DataFrame",".","Index",":","A","single-level","Index",".","Examples","--","--","--","--",">",">",">","ps.DataFrame","(","{","'","a","'",":","[","'","a","'",",","'","b","'",",","'","c","'","]","}",",","index=","[","[","1",",","2",",","3","]",",","[","4",",","5",",","6","]","]",")",".index","#","doctest",":","+SKIP","MultiIndex","(","[","(","1",",","4",")",",","(","2",",","5",")",",","(","3",",","6",")","]",",",")",">",">",">","ps.DataFrame","(","{","'","a","'",":","[","1",",","2",",","3","]","}",",","index=","[","list","(","'abc","'",")",",","list","(","'def","'",")","]",")",".index","#","doctest",":","+SKIP","MultiIndex","(","[","(","'","a","'",",","'d","'",")",",","(","'","b","'",",","'","e","'",")",",","(","'","c","'",",","'","f","'",")","]",",",")"]
docstr: Form the intersection of two Index objects.
  
  This returns a new Index with elements common to the index and `other`.
  
  Parameters
  ----------
  other : Index or array-like
  
  Returns
  -------
  intersection : MultiIndex
  
  Examples
  --------
  >>> midx1 = ps.MultiIndex.from_tuples([("a", "x"), ("b", "y"), ("c", "z")])
  >>> midx2 = ps.MultiIndex.from_tuples([("c", "z"), ("d", "w")])
  >>> midx1.intersection(midx2).sort_values()  # doctest: +SKIP
  MultiIndex([('c', 'z')],
             )
docstr_tok: ["Form","the","intersection","of","two","Index","objects",".","This","returns","a","new","Index","with","elements","common","to","the","index","and","`","other","`",".","Parameters","--","--","--","--","--","other",":","Index","or","array-like","Returns","--","--","--","-","intersection",":","MultiIndex","Examples","--","--","--","--",">",">",">","midx1","=","ps.MultiIndex.from_tuples","(","[","(","``","a","''",",","``","x","''",")",",","(","``","b","''",",","``","y","''",")",",","(","``","c","''",",","``","z","''",")","]",")",">",">",">","midx2","=","ps.MultiIndex.from_tuples","(","[","(","``","c","''",",","``","z","''",")",",","(","``","d","''",",","``","w","''",")","]",")",">",">",">","midx1.intersection","(","midx2",")",".sort_values","(",")","#","doctest",":","+SKIP","MultiIndex","(","[","(","'","c","'",",","'","z","'",")","]",",",")"]
code: def intersection(
      self, other: Union[DataFrame, Series, Index, List]
  ) -> "MultiIndex":
      """
      Form the intersection of two Index objects.
  
      This returns a new Index with elements common to the index and `other`.
  
      Parameters
      ----------
      other : Index or array-like
  
      Returns
      -------
      intersection : MultiIndex
  
      Examples
      --------
      >>> midx1 = ps.MultiIndex.from_tuples([("a", "x"), ("b", "y"), ("c", "z")])
      >>> midx2 = ps.MultiIndex.from_tuples([("c", "z"), ("d", "w")])
      >>> midx1.intersection(midx2).sort_values()  # doctest: +SKIP
      MultiIndex([('c', 'z')],
                 )
      """
      if isinstance(other, Series) or not is_list_like(other):
          raise TypeError(
              "other must be a MultiIndex or a list of tuples"
          )
      elif isinstance(other, DataFrame):
          raise ValueError("Index data must be 1-dimensional")
      elif isinstance(other, MultiIndex):
          spark_frame_other = other.to_frame()._to_spark()
          keep_name = self.names == other.names
      elif isinstance(other, Index):
          # Always returns an empty MultiIndex if `other` is Index.
          return cast(MultiIndex, self.to_frame().head(0).index)
      elif not all(isinstance(item, tuple) for item in other):
          raise TypeError(
              "other must be a MultiIndex or a list of tuples"
          )
      else:
          other = MultiIndex.from_tuples(list(other))
          spark_frame_other = (
              cast(MultiIndex, other).to_frame()._to_spark()
          )
          keep_name = True
  
      index_fields = self._index_fields_for_union_like(
          other, func_name="intersection"
      )
  
      default_name: List[Name] = [
          SPARK_INDEX_NAME_FORMAT(i) for i in range(self.nlevels)
      ]
      spark_frame_self = self.to_frame(name=default_name)._to_spark()
      spark_frame_intersected = spark_frame_self.intersect(
          spark_frame_other
      )
      if keep_name:
          index_names = self._internal.index_names
      else:
          index_names = None
  
      internal = InternalFrame(
          spark_frame=spark_frame_intersected,
          index_spark_columns=[
              scol_for(spark_frame_intersected, cast(str, col))
              for col in default_name
          ],
          index_names=index_names,
          index_fields=index_fields,
      )
      return cast(MultiIndex, DataFrame(internal).index)
  
imports: from functools import partial, reduce
  from typing import Any, Callable, Iterator, List, Optional, Tuple, Union, cast, no_type_check
  import pandas
  from pandas.api.types import is_hashable, is_list_like
  from pyspark.sql import functions, Column, Window
  from pyspark.sql.types import DataType
  from pyspark.sql.utils import get_column_class
  from pyspark import pandas
  from pyspark.pandas._typing import Label, Name, Scalar
  from pyspark.pandas.exceptions import PandasNotImplementedError
  from pyspark.pandas.frame import DataFrame
  from pyspark.pandas.indexes.base import Index
  from pyspark.pandas.missing.indexes import MissingPandasLikeMultiIndex
  from pyspark.pandas.series import Series, first_series
  from pyspark.pandas.utils import compare_disallow_null, is_name_like_tuple, name_like_string, scol_for, verify_temp_column_name, validate_index_loc, xor
  from pyspark.pandas.internal import InternalField, InternalFrame, NATURAL_ORDER_COLUMN_NAME, SPARK_INDEX_NAME_FORMAT
label_desc: Use image node_id 39 for calling the MultiIndex obj's underlying member method code with example usage: obj.intersection(other) and returns: cast, cast