code: def test_categorical_repr_period_ordered(self):
      idx = period_range("2011-01-01 09:00", freq="h", periods=5)
      c = Categorical(idx, ordered=True)
      exp = """[2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00]
  Categories (5, period[h]): [2011-01-01 09:00 < 2011-01-01 10:00 < 2011-01-01 11:00 < 2011-01-01 12:00 <
                              2011-01-01 13:00]"""  # noqa: E501
  
      assert repr(c) == exp
  
      c = Categorical(idx.append(idx), categories=idx, ordered=True)
      exp = """[2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00, 2011-01-01 09:00, 2011-01-01 10:00, 2011-01-01 11:00, 2011-01-01 12:00, 2011-01-01 13:00]
  Categories (5, period[h]): [2011-01-01 09:00 < 2011-01-01 10:00 < 2011-01-01 11:00 < 2011-01-01 12:00 <
                              2011-01-01 13:00]"""  # noqa: E501
  
      assert repr(c) == exp
  
      idx = period_range("2011-01", freq="M", periods=5)
      c = Categorical(idx, ordered=True)
      exp = """[2011-01, 2011-02, 2011-03, 2011-04, 2011-05]
  Categories (5, period[M]): [2011-01 < 2011-02 < 2011-03 < 2011-04 < 2011-05]"""
  
      assert repr(c) == exp
  
      c = Categorical(idx.append(idx), categories=idx, ordered=True)
      exp = """[2011-01, 2011-02, 2011-03, 2011-04, 2011-05, 2011-01, 2011-02, 2011-03, 2011-04, 2011-05]
  Categories (5, period[M]): [2011-01 < 2011-02 < 2011-03 < 2011-04 < 2011-05]"""  # noqa: E501
  
      assert repr(c) == exp
  
imports: import numpy
  import pytest
  from pandas._config import using_pyarrow_string_dtype
  from pandas import Categorical, CategoricalDtype, CategoricalIndex, Index, Series, date_range, option_context, period_range, timedelta_range
label_desc: Use image node_id 11 for calling the TestCategoricalRepr obj's underlying member method code with example usage: obj.test_categorical_repr_period_ordered() without return types