code: def test_categorical_compare_ordered():
      cat1 = pd.Categorical(
          ["a", "a", "b", "c", "a"],
          categories=["a", "b", "c"],
          ordered=True,
      )
      pdsr1 = pd.Series(cat1)
      sr1 = cudf.Series(cat1)
      cat2 = pd.Categorical(
          ["a", "b", "a", "c", "b"],
          categories=["a", "b", "c"],
          ordered=True,
      )
      pdsr2 = pd.Series(cat2)
      sr2 = cudf.Series(cat2)
  
      # test equal
      out = sr1 == sr1
      assert out.dtype == np.bool_
      assert type(out[0]) == np.bool_
      assert np.all(out.to_numpy())
      assert np.all(pdsr1 == pdsr1)
  
      # test inequality
      out = sr1 != sr1
      assert not np.any(out.to_numpy())
      assert not np.any(pdsr1 != pdsr1)
  
      assert pdsr1.cat.ordered
      assert sr1.cat.ordered
  
      # test using ordered operators
      np.testing.assert_array_equal(
          pdsr1 < pdsr2, (sr1 < sr2).to_numpy()
      )
      np.testing.assert_array_equal(
          pdsr1 > pdsr2, (sr1 > sr2).to_numpy()
      )
  
imports: import operator
  import string
  import warnings
  from contextlib import contextmanager
  from textwrap import dedent
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf.core._compat import PANDAS_GE_134
  from cudf.testing._utils import NUMERIC_TYPES, assert_eq, assert_exceptions_equal, expect_warning_if
label_desc: Use image node_id 7 for calling a global function with example usage: test_categorical_compare_ordered() without return types