code: def test_duplicated(idx_dup, keep, expected):
      result = idx_dup.duplicated(keep=keep)
      expected = np.array(expected)
      tm.assert_numpy_array_equal(result, expected)
  
imports: from itertools import product
  import numpy
  import pytest
  from pandas._libs import hashtable, index
  from pandas import NA, DatetimeIndex, Index, MultiIndex, Series
  import pandas._testing
label_desc: Use image node_id 11 for calling a global function with example usage: test_duplicated(idx_dup, keep, expected) without return types