code: def test_tooltips_non_unique_raises(styler):
      # ttips has unique keys
      ttips = DataFrame(
          [["1", "2"], ["3", "4"]], columns=["c", "d"], index=["a", "b"]
      )
      styler.set_tooltips(ttips=ttips)  # OK
  
      # ttips has non-unique columns
      ttips = DataFrame(
          [["1", "2"], ["3", "4"]], columns=["c", "c"], index=["a", "b"]
      )
      with pytest.raises(
          KeyError, match="Tooltips render only if `ttips` has unique"
      ):
          styler.set_tooltips(ttips=ttips)
  
      # ttips has non-unique index
      ttips = DataFrame(
          [["1", "2"], ["3", "4"]], columns=["c", "d"], index=["a", "a"]
      )
      with pytest.raises(
          KeyError, match="Tooltips render only if `ttips` has unique"
      ):
          styler.set_tooltips(ttips=ttips)
  
file_path: pandas/pandas/tests/io/formats/style/test_non_unique.py
imports: from textwrap import dedent
  import pytest
  from pandas import DataFrame, IndexSlice
  from pandas.io.formats.style import Styler
label_desc: Use image node_id 7 for calling a global function with example usage: test_tooltips_non_unique_raises(styler) without return types