class_docstr: Test frequency conversion of date objects
class_docstr_tok: ["Test","frequency","conversion","of","date","objects"]
code: def test_asfreq_MS(self):
      initial = Period("2013")
  
      assert initial.asfreq(freq="M", how="S") == Period("2013-01", "M")
  
      msg = INVALID_FREQ_ERR_MSG
      with pytest.raises(ValueError, match=msg):
          initial.asfreq(freq="MS", how="S")
  
      msg = "MonthBegin is not supported as period frequency"
      with pytest.raises(TypeError, match=msg):
          Period("2013-01", "MS")
  
imports: import pytest
  from pandas._libs.tslibs.period import INVALID_FREQ_ERR_MSG
  from pandas.errors import OutOfBoundsDatetime
  from pandas import Period, Timestamp, offsets
  import pandas._testing
label_desc: Use image node_id 18 for calling the TestFreqConversion obj's underlying member method code with example usage: obj.test_asfreq_MS() without return types