code: def test_legfromroots(self):
      res = leg.legfromroots([])
      assert_almost_equal(trim(res), [1])
      for i in range(1, 5):
          roots = np.cos(np.linspace(-np.pi, 0, 2 * i + 1)[1::2])
          pol = leg.legfromroots(roots)
          res = leg.legval(roots, pol)
          tgt = 0
          assert_(len(pol) == i + 1)
          assert_almost_equal(leg.leg2poly(pol)[-1], 1)
          assert_almost_equal(res, tgt)
  
imports: from functools import reduce
  import numpy
  import numpy.polynomial.legendre
  from numpy.polynomial.polynomial import polyval
  from numpy.testing import assert_almost_equal, assert_raises, assert_equal, assert_
label_desc: Use image node_id 1 for calling the TestMisc obj's underlying member method code with example usage: obj.test_legfromroots() without return types