code: def test_clean_names_strip_underscores(
      multiindex_dataframe,
      strip_underscores,
  ):
      """Tests clean_names `strip_underscores` param on a multi-index
      dataframe.
      """
      if strip_underscores in ["right", "r"]:
          df = multiindex_dataframe.rename(columns=lambda x: x + "_")
      elif strip_underscores in ["left", "l"]:
          df = multiindex_dataframe.rename(columns=lambda x: "_" + x)
      elif strip_underscores in ["both", None]:
          df = multiindex_dataframe.rename(
              columns=lambda x: "_" + x + "_"
          )
      else:
          df = multiindex_dataframe
      df = df.clean_names(strip_underscores=strip_underscores)
  
      levels = [
          ["a", "bell_chart", "decorated_elephant"],
          ["b", "normal_distribution", "r_i_p_rhino"],
      ]
  
      codes = [[1, 0, 2], [1, 0, 2]]
  
      expected_columns = pd.MultiIndex(levels=levels, codes=codes)
      assert set(df.columns) == set(expected_columns)
  
file_path: pyjanitor/tests/functions/test_clean_names.py
imports: import pandas
  import pytest
  from janitor.errors import JanitorError
label_desc: Use image node_id 6 for calling a global function with example usage: test_clean_names_strip_underscores(multiindex_dataframe, strip_underscores) without return types