code: def test_multi_index_header(self):
      # see gh-5539
      columns = MultiIndex.from_tuples(
          [("a", 1), ("a", 2), ("b", 1), ("b", 2)]
      )
      df = DataFrame([[1, 2, 3, 4], [5, 6, 7, 8]])
      df.columns = columns
  
      header = ["a", "b", "c", "d"]
      result = df.to_csv(header=header)
  
      expected_rows = [",a,b,c,d", "0,1,2,3,4", "1,5,6,7,8"]
      expected = tm.convert_rows_list_to_csv_str(expected_rows)
      assert result == expected
  
imports: import csv
  from io import StringIO
  import os
  import numpy
  import pytest
  from pandas.errors import ParserError
  import pandas
  from pandas import DataFrame, Index, MultiIndex, NaT, Series, Timestamp, date_range, period_range, read_csv, to_datetime
  import pandas._testing
  import pandas.core.common
  from pandas.io.common import get_handle
label_desc: Use image node_id 50 for calling the TestDataFrameToCSV obj's underlying member method code with example usage: obj.test_multi_index_header() without return types