code: def test_constructor_nonhashable_names():
      # GH 20527
      levels = [[1, 2], ["one", "two"]]
      codes = [[0, 0, 1, 1], [0, 1, 0, 1]]
      names = (["foo"], ["bar"])
      msg = r"MultiIndex\.name must be a hashable type"
      with pytest.raises(TypeError, match=msg):
          MultiIndex(levels=levels, codes=codes, names=names)
  
      # With .rename()
      mi = MultiIndex(
          levels=[[1, 2], ["one", "two"]],
          codes=[[0, 0, 1, 1], [0, 1, 0, 1]],
          names=("foo", "bar"),
      )
      renamed = [["fooo"], ["barr"]]
      with pytest.raises(TypeError, match=msg):
          mi.rename(names=renamed)
  
      # With .set_names()
      with pytest.raises(TypeError, match=msg):
          mi.set_names(names=renamed)
  
imports: from datetime import date, datetime
  import itertools
  import numpy
  import pytest
  from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
  import pandas
  from pandas import Index, MultiIndex, Series, Timestamp, date_range
  import pandas._testing
label_desc: Use image node_id 3 for calling a global function with example usage: test_constructor_nonhashable_names() without return types