code: def test_pindex_slice_index(self):
      pi = period_range(start="1/1/10", end="12/31/12", freq="M")
      s = Series(np.random.default_rng(2).random(len(pi)), index=pi)
      res = s["2010"]
      exp = s[0:12]
      tm.assert_series_equal(res, exp)
      res = s["2011"]
      exp = s[12:24]
      tm.assert_series_equal(res, exp)
  
file_path: pandas/pandas/tests/indexes/period/test_partial_slicing.py
imports: import numpy
  import pytest
  from pandas import DataFrame, PeriodIndex, Series, date_range, period_range
  import pandas._testing
label_desc: Use image node_id 3 for calling the TestPeriodIndex obj's underlying member method code with example usage: obj.test_pindex_slice_index() without return types