code: def test_cmp(self):
      s1 = slice(1, 2, 3)
      s2 = slice(1, 2, 3)
      s3 = slice(1, 2, 4)
      self.assertEqual(s1, s2)
      self.assertNotEqual(s1, s3)
      self.assertNotEqual(s1, None)
      self.assertNotEqual(s1, (1, 2, 3))
      self.assertNotEqual(s1, "")
  
      class Exc(Exception):
          pass
  
      class BadCmp(object):
          def __eq__(self, other):
              raise Exc
  
      s1 = slice(BadCmp())
      s2 = slice(BadCmp())
      self.assertEqual(s1, s1)
      self.assertRaises(Exc, lambda: s1 == s2)
  
      s1 = slice(1, BadCmp())
      s2 = slice(1, BadCmp())
      self.assertEqual(s1, s1)
      self.assertRaises(Exc, lambda: s1 == s2)
  
      s1 = slice(1, 2, BadCmp())
      s2 = slice(1, 2, BadCmp())
      self.assertEqual(s1, s1)
      self.assertRaises(Exc, lambda: s1 == s2)
  
imports: import itertools
  import operator
  import sys
  import unittest
  import weakref
  import copy
  from pickle import loads, dumps
  from test import support
label_desc: Use image node_id 4 for calling the SliceTest obj's underlying member method code with example usage: obj.test_cmp() without return types