code: def test_keyword_mismatch(self):
      # GH#55961 we should get exactly one of data/ordinals/**fields
      per = Period("2016-01-01", "D")
      depr_msg1 = "The 'ordinal' keyword in PeriodIndex is deprecated"
      depr_msg2 = "Constructing PeriodIndex from fields is deprecated"
  
      err_msg1 = "Cannot pass both data and ordinal"
      with pytest.raises(ValueError, match=err_msg1):
          with tm.assert_produces_warning(
              FutureWarning, match=depr_msg1
          ):
              PeriodIndex(
                  data=[per], ordinal=[per.ordinal], freq=per.freq
              )
  
      err_msg2 = "Cannot pass both data and fields"
      with pytest.raises(ValueError, match=err_msg2):
          with tm.assert_produces_warning(
              FutureWarning, match=depr_msg2
          ):
              PeriodIndex(data=[per], year=[per.year], freq=per.freq)
  
      err_msg3 = "Cannot pass both ordinal and fields"
      with pytest.raises(ValueError, match=err_msg3):
          with tm.assert_produces_warning(
              FutureWarning, match=depr_msg2
          ):
              PeriodIndex(
                  ordinal=[per.ordinal], year=[per.year], freq=per.freq
              )
  
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 2 for calling the TestPeriodIndex obj's underlying member method code with example usage: obj.test_keyword_mismatch() without return types