code: def test_comparison_with_unknown_scalars(self):
      # https://github.com/pandas-dev/pandas/issues/9836#issuecomment-92123057
      # and following comparisons with scalars not in categories should raise
      # for unequal comps, but not for equal/not equal
      cat = Categorical([1, 2, 3], ordered=True)
  
      msg = "Invalid comparison between dtype=category and int"
      with pytest.raises(TypeError, match=msg):
          cat < 4
      with pytest.raises(TypeError, match=msg):
          cat > 4
      with pytest.raises(TypeError, match=msg):
          4 < cat
      with pytest.raises(TypeError, match=msg):
          4 > cat
  
      tm.assert_numpy_array_equal(
          cat == 4, np.array([False, False, False])
      )
      tm.assert_numpy_array_equal(
          cat != 4, np.array([True, True, True])
      )
  
imports: import numpy
  import pytest
  import pandas
  from pandas import Categorical, DataFrame, Series, Timestamp, date_range
  import pandas._testing
label_desc: Use image node_id 6 for calling the TestCategoricalOps obj's underlying member method code with example usage: obj.test_comparison_with_unknown_scalars() without return types