nodes: 0, module; 1, function_definition; 2, function_name:intersection; 3, parameters; 4, block; 5, identifier:self; 6, identifier:other; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, expression_statement; 14, expression_statement; 15, expression_statement; 16, if_statement; 17, if_statement; 18, identifier:sort; 19, False; 20, comment:"""
          Form the intersection of two MultiIndex objects.
  
          Parameters
          ----------
          other : MultiIndex or array / Index of tuples
          sort : False or None, default False
              Sort the resulting MultiIndex if possible
  
              .. versionadded:: 0.24.0
  
              .. versionchanged:: 0.24.1
  
                 Changed the default from ``True`` to ``False``, to match
                 behaviour from before 0.24.0
  
          Returns
          -------
          Index
          """; 21, call; 22, call; 23, assignment; 24, call; 25, block; 26, assignment; 27, assignment; 28, assignment; 29, comparison_operator:sort is None; 30, block; 31, comparison_operator:len(uniq_tuples) == 0; 32, block; 33, else_clause; 34, attribute; 35, argument_list; 36, attribute; 37, argument_list; 38, pattern_list; 39, call; 40, attribute; 41, argument_list; 42, return_statement; 43, identifier:self_tuples; 44, attribute; 45, identifier:other_tuples; 46, attribute; 47, identifier:uniq_tuples; 48, binary_operator:set(self_tuples) & set(other_tuples); 49, identifier:sort; 50, None; 51, expression_statement; 52, call; 53, integer:0; 54, return_statement; 55, block; 56, identifier:self; 57, identifier:_validate_sort_keyword; 58, identifier:sort; 59, identifier:self; 60, identifier:_assert_can_do_setop; 61, identifier:other; 62, identifier:other; 63, identifier:result_names; 64, attribute; 65, argument_list; 66, identifier:self; 67, identifier:equals; 68, identifier:other; 69, identifier:self; 70, identifier:self; 71, identifier:_ndarray_values; 72, identifier:other; 73, identifier:_ndarray_values; 74, call; 75, call; 76, assignment; 77, identifier:len; 78, argument_list; 79, call; 80, return_statement; 81, identifier:self; 82, identifier:_convert_can_do_setop; 83, identifier:other; 84, identifier:set; 85, argument_list; 86, identifier:set; 87, argument_list; 88, identifier:uniq_tuples; 89, call; 90, identifier:uniq_tuples; 91, identifier:MultiIndex; 92, argument_list; 93, call; 94, identifier:self_tuples; 95, identifier:other_tuples; 96, identifier:sorted; 97, argument_list; 98, keyword_argument; 99, keyword_argument; 100, keyword_argument; 101, keyword_argument; 102, attribute; 103, argument_list; 104, identifier:uniq_tuples; 105, identifier:levels; 106, attribute; 107, identifier:codes; 108, binary_operator:[[]] * self.nlevels; 109, identifier:names; 110, identifier:result_names; 111, identifier:verify_integrity; 112, False; 113, identifier:MultiIndex; 114, identifier:from_arrays; 115, call; 116, keyword_argument; 117, keyword_argument; 118, identifier:self; 119, identifier:levels; 120, list; 121, attribute; 122, identifier:lzip; 123, argument_list; 124, identifier:sortorder; 125, integer:0; 126, identifier:names; 127, identifier:result_names; 128, list; 129, identifier:self; 130, identifier:nlevels; 131, list_splat; 132, identifier:uniq_tuples
code: def intersection(self, other, sort=False):
          """
          Form the intersection of two MultiIndex objects.
  
          Parameters
          ----------
          other : MultiIndex or array / Index of tuples
          sort : False or None, default False
              Sort the resulting MultiIndex if possible
  
              .. versionadded:: 0.24.0
  
              .. versionchanged:: 0.24.1
  
                 Changed the default from ``True`` to ``False``, to match
                 behaviour from before 0.24.0
  
          Returns
          -------
          Index
          """
          self._validate_sort_keyword(sort)
          self._assert_can_do_setop(other)
          other, result_names = self._convert_can_do_setop(other)
  
          if self.equals(other):
              return self
  
          self_tuples = self._ndarray_values
          other_tuples = other._ndarray_values
          uniq_tuples = set(self_tuples) & set(other_tuples)
  
          if sort is None:
              uniq_tuples = sorted(uniq_tuples)
  
          if len(uniq_tuples) == 0:
              return MultiIndex(levels=self.levels,
                                codes=[[]] * self.nlevels,
                                names=result_names, verify_integrity=False)
          else:
              return MultiIndex.from_arrays(lzip(*uniq_tuples), sortorder=0,
                                            names=result_names)