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: Compute the symmetric difference of two MultiIndex objects.
  
  Parameters
  ----------
  other : Index or array-like
  result_name : list
  sort : True or None, default None
      Whether to sort the resulting index.
      * True : Attempt to sort the result.
      * None : Do not sort the result.
  
  Returns
  -------
  symmetric_difference : MultiIndex
  
  Notes
  -----
  ``symmetric_difference`` contains elements that appear in either
  ``idx1`` or ``idx2`` but not both. Equivalent to the Index created by
  ``idx1.difference(idx2) | idx2.difference(idx1)`` with duplicates
  dropped.
  
  Examples
  --------
  >>> midx1 = pd.MultiIndex([['lama', 'cow', 'falcon'],
  ...                        ['speed', 'weight', 'length']],
  ...                       [[0, 0, 0, 1, 1, 1, 2, 2, 2],
  ...                        [0, 0, 0, 0, 1, 2, 0, 1, 2]])
  >>> midx2 = pd.MultiIndex([['pandas-on-Spark', 'cow', 'falcon'],
  ...                        ['speed', 'weight', 'length']],
  ...                       [[0, 0, 0, 1, 1, 1, 2, 2, 2],
  ...                        [0, 0, 0, 0, 1, 2, 0, 1, 2]])
  >>> s1 = ps.Series([45, 200, 1.2, 30, 250, 1.5, 320, 1, 0.3],
  ...                index=midx1)
  >>> s2 = ps.Series([45, 200, 1.2, 30, 250, 1.5, 320, 1, 0.3],
  ...              index=midx2)
  
  >>> s1.index.symmetric_difference(s2.index)  # doctest: +SKIP
  MultiIndex([('pandas-on-Spark', 'speed'),
              (  'lama', 'speed')],
             )
  
  You can set names of the result Index.
  
  >>> s1.index.symmetric_difference(s2.index, result_name=['a', 'b'])  # doctest: +SKIP
  MultiIndex([('pandas-on-Spark', 'speed'),
              (  'lama', 'speed')],
             names=['a', 'b'])
  
  You can set sort to `True`, if you want to sort the resulting index.
  
  >>> s1.index.symmetric_difference(s2.index, sort=True)  # doctest: +SKIP
  MultiIndex([('pandas-on-Spark', 'speed'),
              (  'lama', 'speed')],
             )
  
  You can also use the ``^`` operator:
  
  >>> s1.index ^ s2.index  # doctest: +SKIP
  MultiIndex([('pandas-on-Spark', 'speed'),
              (  'lama', 'speed')],
             )
docstr_tok: ["Compute","the","symmetric","difference","of","two","MultiIndex","objects",".","Parameters","--","--","--","--","--","other",":","Index","or","array-like","result_name",":","list","sort",":","True","or","None",",","default","None","Whether","to","sort","the","resulting","index",".","*","True",":","Attempt","to","sort","the","result",".","*","None",":","Do","not","sort","the","result",".","Returns","--","--","--","-","symmetric_difference",":","MultiIndex","Notes","--","--","-","``","symmetric_difference","``","contains","elements","that","appear","in","either","``","idx1","``","or","``","idx2","``","but","not","both",".","Equivalent","to","the","Index","created","by","``","idx1.difference","(","idx2",")","|","idx2.difference","(","idx1",")","``","with","duplicates","dropped",".","Examples","--","--","--","--",">",">",">","midx1","=","pd.MultiIndex","(","[","[","'lama","'",",","'cow","'",",","'falcon","'","]",",","...","[","'speed","'",",","'weight","'",",","'length","'","]","]",",","...","[","[","0",",","0",",","0",",","1",",","1",",","1",",","2",",","2",",","2","]",",","...","[","0",",","0",",","0",",","0",",","1",",","2",",","0",",","1",",","2","]","]",")",">",">",">","midx2","=","pd.MultiIndex","(","[","[","'pandas-on-Spark","'",",","'cow","'",",","'falcon","'","]",",","...","[","'speed","'",",","'weight","'",",","'length","'","]","]",",","...","[","[","0",",","0",",","0",",","1",",","1",",","1",",","2",",","2",",","2","]",",","...","[","0",",","0",",","0",",","0",",","1",",","2",",","0",",","1",",","2","]","]",")",">",">",">","s1","=","ps.Series","(","[","45",",","200",",","1.2",",","30",",","250",",","1.5",",","320",",","1",",","0.3","]",",","...","index=midx1",")",">",">",">","s2","=","ps.Series","(","[","45",",","200",",","1.2",",","30",",","250",",","1.5",",","320",",","1",",","0.3","]",",","...","index=midx2",")",">",">",">","s1.index.symmetric_difference","(","s2.index",")","#","doctest",":","+SKIP","MultiIndex","(","[","(","'pandas-on-Spark","'",",","'speed","'",")",",","(","'lama","'",",","'speed","'",")","]",",",")","You","can","set","names","of","the","result","Index",".",">",">",">","s1.index.symmetric_difference","(","s2.index",",","result_name=","[","'","a","'",",","'","b","'","]",")","#","doctest",":","+SKIP","MultiIndex","(","[","(","'pandas-on-Spark","'",",","'speed","'",")",",","(","'lama","'",",","'speed","'",")","]",",","names=","[","'","a","'",",","'","b","'","]",")","You","can","set","sort","to","`","True","`",",","if","you","want","to","sort","the","resulting","index",".",">",">",">","s1.index.symmetric_difference","(","s2.index",",","sort=True",")","#","doctest",":","+SKIP","MultiIndex","(","[","(","'pandas-on-Spark","'",",","'speed","'",")",",","(","'lama","'",",","'speed","'",")","]",",",")","You","can","also","use","the","``","^","``","operator",":",">",">",">","s1.index","^","s2.index","#","doctest",":","+SKIP","MultiIndex","(","[","(","'pandas-on-Spark","'",",","'speed","'",")",",","(","'lama","'",",","'speed","'",")","]",",",")"]
code: def symmetric_difference(  # type: ignore[override]
      self,
      other: Index,
      result_name: Optional[List[Name]] = None,
      sort: Optional[bool] = None,
  ) -> "MultiIndex":
      """
      Compute the symmetric difference of two MultiIndex objects.
  
      Parameters
      ----------
      other : Index or array-like
      result_name : list
      sort : True or None, default None
          Whether to sort the resulting index.
          * True : Attempt to sort the result.
          * None : Do not sort the result.
  
      Returns
      -------
      symmetric_difference : MultiIndex
  
      Notes
      -----
      ``symmetric_difference`` contains elements that appear in either
      ``idx1`` or ``idx2`` but not both. Equivalent to the Index created by
      ``idx1.difference(idx2) | idx2.difference(idx1)`` with duplicates
      dropped.
  
      Examples
      --------
      >>> midx1 = pd.MultiIndex([['lama', 'cow', 'falcon'],
      ...                        ['speed', 'weight', 'length']],
      ...                       [[0, 0, 0, 1, 1, 1, 2, 2, 2],
      ...                        [0, 0, 0, 0, 1, 2, 0, 1, 2]])
      >>> midx2 = pd.MultiIndex([['pandas-on-Spark', 'cow', 'falcon'],
      ...                        ['speed', 'weight', 'length']],
      ...                       [[0, 0, 0, 1, 1, 1, 2, 2, 2],
      ...                        [0, 0, 0, 0, 1, 2, 0, 1, 2]])
      >>> s1 = ps.Series([45, 200, 1.2, 30, 250, 1.5, 320, 1, 0.3],
      ...                index=midx1)
      >>> s2 = ps.Series([45, 200, 1.2, 30, 250, 1.5, 320, 1, 0.3],
      ...              index=midx2)
  
      >>> s1.index.symmetric_difference(s2.index)  # doctest: +SKIP
      MultiIndex([('pandas-on-Spark', 'speed'),
                  (  'lama', 'speed')],
                 )
  
      You can set names of the result Index.
  
      >>> s1.index.symmetric_difference(s2.index, result_name=['a', 'b'])  # doctest: +SKIP
      MultiIndex([('pandas-on-Spark', 'speed'),
                  (  'lama', 'speed')],
                 names=['a', 'b'])
  
      You can set sort to `True`, if you want to sort the resulting index.
  
      >>> s1.index.symmetric_difference(s2.index, sort=True)  # doctest: +SKIP
      MultiIndex([('pandas-on-Spark', 'speed'),
                  (  'lama', 'speed')],
                 )
  
      You can also use the ``^`` operator:
  
      >>> s1.index ^ s2.index  # doctest: +SKIP
      MultiIndex([('pandas-on-Spark', 'speed'),
                  (  'lama', 'speed')],
                 )
      """
      if type(self) != type(other):
          raise NotImplementedError(
              "Doesn't support symmetric_difference between Index & MultiIndex for now"
          )
  
      sdf_self = self._psdf._internal.spark_frame.select(
          self._internal.index_spark_columns
      )
      sdf_other = other._psdf._internal.spark_frame.select(
          other._internal.index_spark_columns
      )
      sdf_symdiff = xor(sdf_self, sdf_other)
  
      if sort:
          sdf_symdiff = sdf_symdiff.sort(
              *self._internal.index_spark_column_names
          )
  
      internal = InternalFrame(
          spark_frame=sdf_symdiff,
          index_spark_columns=[
              scol_for(sdf_symdiff, col)
              for col in self._internal.index_spark_column_names
          ],
          index_names=self._internal.index_names,
          index_fields=self._internal.index_fields,
      )
      result = cast(MultiIndex, DataFrame(internal).index)
  
      if result_name:
          result.names = result_name
  
      return result
  
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 28 for calling the MultiIndex obj's underlying member method code with example usage: obj.symmetric_difference(other, result_name, sort) and returns: result