code: def test_frame_setitem_partial_multiindex():
      # GH 54875
      df = DataFrame(
          {
              "a": [1, 2, 3],
              "b": [3, 4, 5],
              "c": 6,
              "d": 7,
          }
      ).set_index(["a", "b", "c"])
      ser = Series(8, index=df.index.droplevel("c"))
      result = df.copy()
      result["d"] = ser
      expected = df.copy()
      expected["d"] = 8
      tm.assert_frame_equal(result, expected)
  
imports: import numpy
  import pytest
  from pandas.errors import SettingWithCopyError
  import pandas
  from pandas import DataFrame, MultiIndex, Series, date_range, isna, notna
  import pandas._testing
label_desc: Use image node_id 5 for calling a global function with example usage: test_frame_setitem_partial_multiindex() without return types