code: def test_apply(test_frame):
      g = test_frame.groupby("A")
      r = g.resample("2s")
  
      # reduction
      msg = "DataFrameGroupBy.resample operated on the grouping columns"
      with tm.assert_produces_warning(FutureWarning, match=msg):
          expected = g.resample("2s").sum()
  
      def f_0(x):
          return x.resample("2s").sum()
  
      msg = "DataFrameGroupBy.resample operated on the grouping columns"
      with tm.assert_produces_warning(FutureWarning, match=msg):
          result = r.apply(f_0)
      tm.assert_frame_equal(result, expected)
  
      def f_1(x):
          return x.resample("2s").apply(lambda y: y.sum())
  
      msg = "DataFrameGroupBy.apply operated on the grouping columns"
      with tm.assert_produces_warning(FutureWarning, match=msg):
          result = g.apply(f_1)
      # y.sum() results in int64 instead of int32 on 32-bit architectures
      expected = expected.astype("int64")
      tm.assert_frame_equal(result, expected)
  
imports: from textwrap import dedent
  import numpy
  import pytest
  from pandas.compat import is_platform_windows
  import pandas
  from pandas import DataFrame, Index, Series, TimedeltaIndex, Timestamp
  import pandas._testing
  from pandas.core.indexes.datetimes import date_range
label_desc: Use image node_id 12 for calling a global function with example usage: test_apply(test_frame) and returns: x, x