code: def test_expanding_apply_consistency_sum_nans(
      request, all_data, min_periods, f
  ):
      if f is np.sum:
          if not no_nans(all_data) and not (
              all_na(all_data)
              and not all_data.empty
              and min_periods > 0
          ):
              request.applymarker(
                  pytest.mark.xfail(
                      reason="np.sum has different behavior with NaNs"
                  )
              )
      expanding_f_result = all_data.expanding(
          min_periods=min_periods
      ).sum()
      expanding_apply_f_result = all_data.expanding(
          min_periods=min_periods
      ).apply(func=f, raw=True)
      tm.assert_equal(expanding_f_result, expanding_apply_f_result)
  
file_path: pandas/pandas/tests/window/moments/test_moments_consistency_expanding.py
imports: import numpy
  import pytest
  from pandas import Series
  import pandas._testing
label_desc: Use image node_id 3 for calling a global function with example usage: test_expanding_apply_consistency_sum_nans(request, all_data, min_periods, f) without return types