code: def test_format_duplicate_labels_message():
      idx = pd.Index(["a", "b", "a", "b", "c"])
      result = idx._format_duplicate_message()
      expected = pd.DataFrame(
          {"positions": [[0, 2], [1, 3]]},
          index=pd.Index(["a", "b"], name="label"),
      )
      tm.assert_frame_equal(result, expected)
  
imports: import operator
  import numpy
  import pytest
  import pandas
  import pandas._testing
label_desc: Use image node_id 2 for calling a global function with example usage: test_format_duplicate_labels_message() without return types