code: def test_expand_multiple_levels_flatten_levels(df_expand):
      """Test output for names_expand for multiple names_from."""
      expected = df_expand.pivot_wider(
          "id",
          ("year", "gender"),
          "percentage",
          names_expand=True,
          flatten_levels=True,
      )
      actual = (
          df_expand.complete("year", "gender", "id")
          .pivot(
              index="id",
              columns=("year", "gender"),
              values="percentage",
          )
          .collapse_levels()
          .reset_index()
      )
      assert_frame_equal(actual, expected)
  
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
label_desc: Use image node_id 36 for calling a global function with example usage: test_expand_multiple_levels_flatten_levels(df_expand) without return types