code: def test_constructor_incompat_freq(self):
      msg = "Input has different freq=D from PeriodIndex\\(freq=M\\)"
  
      with pytest.raises(IncompatibleFrequency, match=msg):
          PeriodIndex(
              [
                  Period("2011-01", freq="M"),
                  NaT,
                  Period("2011-01", freq="D"),
              ]
          )
  
      with pytest.raises(IncompatibleFrequency, match=msg):
          PeriodIndex(
              np.array(
                  [
                      Period("2011-01", freq="M"),
                      NaT,
                      Period("2011-01", freq="D"),
                  ]
              )
          )
  
      # first element is NaT
      with pytest.raises(IncompatibleFrequency, match=msg):
          PeriodIndex(
              [
                  NaT,
                  Period("2011-01", freq="M"),
                  Period("2011-01", freq="D"),
              ]
          )
  
      with pytest.raises(IncompatibleFrequency, match=msg):
          PeriodIndex(
              np.array(
                  [
                      NaT,
                      Period("2011-01", freq="M"),
                      Period("2011-01", freq="D"),
                  ]
              )
          )
  
imports: import numpy
  import pytest
  from pandas._libs.tslibs.period import IncompatibleFrequency
  from pandas.core.dtypes.dtypes import PeriodDtype
  from pandas import Index, NaT, Period, PeriodIndex, Series, date_range, offsets, period_range
  import pandas._testing
  from pandas.core.arrays import PeriodArray
label_desc: Use image node_id 19 for calling the TestPeriodIndex obj's underlying member method code with example usage: obj.test_constructor_incompat_freq() without return types