code: def test_monomial_inverse(self):
      # The Zero monomial is not invertible.
      self.assertRaises(ValueError, lambda x: x.inverse(), self.m1)
      self.assertRaises(ValueError, lambda x: x.inverse(), self.m8)
      self.assertRaises(
          ValueError, lambda x: x.inverse(), Monomial({}, self.m12)
      )
  
      # Check some inverses.
      self.assertEqual(
          self.m7.inverse(), Monomial({1: -2, 7: -2}, -1 / math.pi)
      )
  
      # Doesn't matter if the coefficient is Fraction or float.
      # Both should be treated as same.
      self.assertEqual(
          self.m5.inverse(), Monomial({2: -1}, Fraction(3, 2))
      )
      self.assertEqual(self.m5.inverse(), Monomial({2: -1}, 1.5))
  
      # Should work fine without variables too!
      self.assertTrue(
          self.m6.inverse(), Monomial({}, Fraction(-100, 227))
      )
      self.assertEqual(self.m6.inverse(), Monomial({}, -1 / 2.27))
      return
  
file_path: keon-algos/tests/test_monomial.py
imports: from algorithms.maths.polynomial import Monomial
  from fractions import Fraction
  import math
  import unittest
label_desc: Use image node_id 5 for calling the TestSuite obj's underlying member method code with example usage: obj.test_monomial_inverse() without return types