code: def test_intersection_duplicates_all_indexes(index):
      # GH#38743
      if index.empty:
          # No duplicates in empty indexes
          pytest.skip("Not relevant for empty Index")
  
      idx = index
      idx_non_unique = idx[[0, 0, 1, 2]]
  
      assert idx.intersection(idx_non_unique).equals(
          idx_non_unique.intersection(idx)
      )
      assert idx.intersection(idx_non_unique).is_unique
  
imports: from datetime import datetime
  import operator
  import numpy
  import pytest
  from pandas._libs import lib
  from pandas.core.dtypes.cast import find_common_type
  from pandas import CategoricalDtype, CategoricalIndex, DatetimeTZDtype, Index, MultiIndex, PeriodDtype, RangeIndex, Series, Timestamp
  import pandas._testing
  from pandas.api.types import is_signed_integer_dtype, pandas_dtype
label_desc: Use image node_id 10 for calling a global function with example usage: test_intersection_duplicates_all_indexes(index) without return types