code: def test_numeric_compat(idx):
      with pytest.raises(TypeError, match="cannot perform __mul__"):
          idx * 1
  
      with pytest.raises(TypeError, match="cannot perform __rmul__"):
          1 * idx
  
      div_err = "cannot perform __truediv__"
      with pytest.raises(TypeError, match=div_err):
          idx / 1
  
      div_err = div_err.replace(" __", " __r")
      with pytest.raises(TypeError, match=div_err):
          1 / idx
  
      with pytest.raises(
          TypeError, match="cannot perform __floordiv__"
      ):
          idx // 1
  
      with pytest.raises(
          TypeError, match="cannot perform __rfloordiv__"
      ):
          1 // idx
  
file_path: pandas/pandas/tests/indexes/multi/test_compat.py
imports: import numpy
  import pytest
  import pandas
  from pandas import MultiIndex
  import pandas._testing
label_desc: Use image node_id 1 for calling a global function with example usage: test_numeric_compat(idx) without return types