code: def test_series_apply_execution(setup):
      s = pd.Series([1, 2, 3, 4])
      ms = md.Series(s)
  
      apply_func = lambda x: x + 1
      res = ms.apply(apply_func, output_type="df_or_series").execute()
      assert res.data_type == "series"
      assert res.data_params["shape"] == (4,)
      assert res.data_params["dtype"] == "int64"
      pd.testing.assert_series_equal(res.fetch(), s.apply(apply_func))
  
      apply_func = lambda x: [1, 2]
      res = ms.apply(apply_func, output_type="df_or_series").execute()
      assert res.data_type == "series"
      assert res.data_params["shape"] == (4,)
      assert res.data_params["dtype"] == "object"
      pd.testing.assert_series_equal(res.fetch(), s.apply(apply_func))
  
      apply_func = lambda x: pd.Series([1, 2, 3])
      res = ms.apply(apply_func, output_type="df_or_series").execute()
      assert res.data_type == "dataframe"
      assert "dtypes" in res.data_params
      assert res.data_params["shape"] == (4, 3)
      pd.testing.assert_frame_equal(res.fetch(), s.apply(apply_func))
  
      def subtract_custom_value(x, custom_value):
          return x - custom_value
  
      apply_func = subtract_custom_value
      res = ms.apply(
          apply_func,
          args=(5,),
          convert_dtype=False,
          output_type="df_or_series",
      ).execute()
      assert res.data_params["dtype"] == "object"
      pd.testing.assert_series_equal(
          res.fetch(),
          s.apply(apply_func, args=(5,), convert_dtype=False),
      )
  
      res = ms.apply(
          apply_func,
          args=(5,),
          convert_dtype=True,
          output_type="df_or_series",
      ).execute()
      assert res.dtype == "int64"
      assert res.shape == (4,)
      with pytest.raises(AttributeError):
          _ = res.dtypes
      pd.testing.assert_series_equal(
          res.fetch(),
          s.apply(apply_func, args=(5,), convert_dtype=True),
      )
  
file_path: mars/mars/dataframe/base/tests/test_apply_execution.py
imports: import numpy
  import pandas
  import pytest
  from ....None import dataframe
  from ....dataframe.core import DataFrame, DATAFRAME_OR_SERIES_TYPE
  from ....dataframe.fetch.core import DataFrameFetch
label_desc: Use image node_id 3 for calling a global function with example usage: test_series_apply_execution(setup) and returns: unknown