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