code: def test_apply_box_period():
      # period
      vals = [
          pd.Period("2011-01-01", freq="M"),
          pd.Period("2011-01-02", freq="M"),
      ]
      ser = Series(vals)
      assert ser.dtype == "Period[M]"
      res = ser.apply(
          lambda x: f"{type(x).__name__}_{x.freqstr}", by_row="compat"
      )
      exp = Series(["Period_M", "Period_M"])
      tm.assert_series_equal(res, exp)
  
imports: import numpy
  import pytest
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series, concat, date_range, timedelta_range
  import pandas._testing
  from pandas.tests.apply.common import series_transform_kernels
label_desc: Use image node_id 13 for calling a global function with example usage: test_apply_box_period() without return types