code: def test_complex(self):
      # comparisons with complex are special:  equality and inequality
      # comparisons should always succeed, but order comparisons should
      # raise TypeError.
      z = 1.0 + 0j
      w = -3.14 + 2.7j
  
      for v in 1, 1.0, F(1), D(1), complex(1):
          self.assertEqual(z, v)
          self.assertEqual(v, z)
  
      for v in 2, 2.0, F(2), D(2), complex(2):
          self.assertNotEqual(z, v)
          self.assertNotEqual(v, z)
          self.assertNotEqual(w, v)
          self.assertNotEqual(v, w)
  
      for v in (
          1,
          1.0,
          F(1),
          D(1),
          complex(1),
          2,
          2.0,
          F(2),
          D(2),
          complex(2),
          w,
      ):
          for op in operator.le, operator.lt, operator.ge, operator.gt:
              self.assertRaises(TypeError, op, z, v)
              self.assertRaises(TypeError, op, v, z)
  
imports: import unittest
  import random
  import math
  import sys
  import operator
  from decimal import Decimal
  from fractions import Fraction
label_desc: Use image node_id 2 for calling the ComparisonTest obj's underlying member method code with example usage: obj.test_complex() without return types