code: def test_searchsorted(self, freq):
      pidx = PeriodIndex(
          [
              "2014-01-01",
              "2014-01-02",
              "2014-01-03",
              "2014-01-04",
              "2014-01-05",
          ],
          freq=freq,
      )
  
      p1 = Period("2014-01-01", freq=freq)
      assert pidx.searchsorted(p1) == 0
  
      p2 = Period("2014-01-04", freq=freq)
      assert pidx.searchsorted(p2) == 3
  
      assert pidx.searchsorted(NaT) == 5
  
      msg = "Input has different freq=h from PeriodArray"
      with pytest.raises(IncompatibleFrequency, match=msg):
          pidx.searchsorted(Period("2014-01-01", freq="h"))
  
      msg = "Input has different freq=5D from PeriodArray"
      with pytest.raises(IncompatibleFrequency, match=msg):
          pidx.searchsorted(Period("2014-01-01", freq="5D"))
  
file_path: pandas/pandas/tests/indexes/period/test_searchsorted.py
imports: import numpy
  import pytest
  from pandas._libs.tslibs import IncompatibleFrequency
  from pandas import NaT, Period, PeriodIndex
  import pandas._testing
label_desc: Use image node_id 1 for calling the TestSearchsorted obj's underlying member method code with example usage: obj.test_searchsorted(freq) without return types