code: def test_polytrim(self):
      coef = [2, -1, 1, 0]
  
      # Test exceptions
      assert_raises(ValueError, poly.polytrim, coef, -1)
  
      # Test results
      assert_equal(poly.polytrim(coef), coef[:-1])
      assert_equal(poly.polytrim(coef, 1), coef[:-3])
      assert_equal(poly.polytrim(coef, 2), [0])
  
imports: from functools import reduce
  from fractions import Fraction
  import numpy
  import numpy.polynomial.polynomial
  import pickle
  from copy import deepcopy
  from numpy.testing import assert_almost_equal, assert_raises, assert_equal, assert_, assert_array_equal, assert_raises_regex
label_desc: Use image node_id 4 for calling the TestMisc obj's underlying member method code with example usage: obj.test_polytrim() without return types