code: def test_longtable_multiindex_columns(df, sparse, exp, siunitx):
      cidx = MultiIndex.from_tuples(
          [("A", "a"), ("A", "b"), ("B", "c")]
      )
      df.columns = cidx
      with_si = "{} & {a} & {b} & {c} \\\\"
      without_si = " & a & b & c \\\\"
      expected = dedent(
          f"""\
          \\begin{{longtable}}{{l{"SS" if siunitx else "rr"}l}}
          {exp} \\\\
          {with_si if siunitx else without_si}
          \\endfirsthead
          {exp} \\\\
          {with_si if siunitx else without_si}
          \\endhead
          """
      )
      result = df.style.to_latex(
          environment="longtable",
          sparse_columns=sparse,
          siunitx=siunitx,
      )
      assert expected in result
  
imports: from textwrap import dedent
  import numpy
  import pytest
  from pandas import DataFrame, MultiIndex, Series, option_context
  from pandas.io.formats.style import Styler
  from pandas.io.formats.style_render import _parse_latex_cell_styles, _parse_latex_css_conversion, _parse_latex_header_span, _parse_latex_table_styles, _parse_latex_table_wrapping
label_desc: Use image node_id 38 for calling a global function with example usage: test_longtable_multiindex_columns(df, sparse, exp, siunitx) without return types