code: def test_set_flags_with_duplicates(self, cls, axes):
      result = cls(**axes)
      assert result.flags.allows_duplicate_labels is True
  
      msg = "Index has duplicates."
      with pytest.raises(pd.errors.DuplicateLabelError, match=msg):
          cls(**axes).set_flags(allows_duplicate_labels=False)
  
imports: import operator
  import numpy
  import pytest
  import pandas
  import pandas._testing
label_desc: Use image node_id 1 for calling the TestRaises obj's underlying member method code with example usage: obj.test_set_flags_with_duplicates(cls, axes) without return types