code: def test_poly(self):
      assert_array_almost_equal(
          np.poly([3, -np.sqrt(2), np.sqrt(2)]), [1, -3, -2, 6]
      )
  
      # From matlab docs
      A = [[1, 2, 3], [4, 5, 6], [7, 8, 0]]
      assert_array_almost_equal(np.poly(A), [1, -6, -72, -27])
  
      # Should produce real output for perfect conjugates
      assert_(
          np.isrealobj(np.poly([+1.082j, +2.613j, -2.613j, -1.082j]))
      )
      assert_(
          np.isrealobj(
              np.poly(
                  [
                      0 + 1j,
                      -0 + -1j,
                      1 + 2j,
                      1 - 2j,
                      1.0 + 3.5j,
                      1 - 3.5j,
                  ]
              )
          )
      )
      assert_(
          np.isrealobj(
              np.poly([1j, -1j, 1 + 2j, 1 - 2j, 1 + 3j, 1 - 3.0j])
          )
      )
      assert_(np.isrealobj(np.poly([1j, -1j, 1 + 2j, 1 - 2j])))
      assert_(np.isrealobj(np.poly([1j, -1j, 2j, -2j])))
      assert_(np.isrealobj(np.poly([1j, -1j])))
      assert_(np.isrealobj(np.poly([1, -1])))
  
      assert_(np.iscomplexobj(np.poly([1j, -1.0000001j])))
  
      np.random.seed(42)
      a = np.random.randn(100) + 1j * np.random.randn(100)
      assert_(
          np.isrealobj(np.poly(np.concatenate((a, np.conjugate(a)))))
      )
  
imports: import numpy
  from numpy.testing import assert_, assert_equal, assert_array_equal, assert_almost_equal, assert_array_almost_equal, assert_raises, assert_allclose
  import pytest
label_desc: Use image node_id 6 for calling the TestPolynomial obj's underlying member method code with example usage: obj.test_poly() without return types