code: def test_equality(self):
      a = QN("a")
      a2 = QN("a")
      a_b = QN(a, attr="b")
      self.assertEqual(a2.qn, ("a",))
      with self.assertRaises(ValueError):
          _ = a.parent
  
      a_b2 = QN(a, attr="b")
      self.assertEqual(a_b2.qn, (a, "b"))
      self.assertEqual(a_b2.parent.qn, ("a",))
  
      self.assertTrue(a2 == a)
      self.assertFalse(a2 is a)
  
      self.assertTrue(a_b.parent == a)
      self.assertTrue(a_b2.parent == a)
  
      self.assertTrue(a_b2 == a_b)
      self.assertFalse(a_b2 is a_b)
      self.assertFalse(a_b2 == a)
      a_sub_b = QN(a, subscript="b")
      a_sub_b2 = QN(a, subscript="b")
      self.assertTrue(a_sub_b == a_sub_b2)
      self.assertFalse(a_sub_b == a_b)
  
imports: import textwrap
  from tensorflow.python.autograph.pyct import anno
  from tensorflow.python.autograph.pyct import parser
  from tensorflow.python.autograph.pyct import qual_names
  from tensorflow.python.autograph.pyct.qual_names import QN
  from tensorflow.python.autograph.pyct.qual_names import resolve
  from tensorflow.python.platform import test
label_desc: Use image node_id 4 for calling the QNTest obj's underlying member method code with example usage: obj.test_equality() without return types