code: def test_DMP_arithmetics():
      f = DMP([[ZZ(2)], [ZZ(2), ZZ(0)]], ZZ)
  
      assert f.mul_ground(2) == DMP([[ZZ(4)], [ZZ(4), ZZ(0)]], ZZ)
      assert f.quo_ground(2) == DMP([[ZZ(1)], [ZZ(1), ZZ(0)]], ZZ)
  
      raises(ExactQuotientFailed, lambda: f.exquo_ground(3))
  
      f = DMP([[ZZ(-5)]], ZZ)
      g = DMP([[ZZ(5)]], ZZ)
  
      assert f.abs() == g
      assert abs(f) == g
  
      assert g.neg() == f
      assert -g == f
  
      h = DMP([[]], ZZ)
  
      assert f.add(g) == h
      assert f + g == h
      assert g + f == h
      assert f + 5 == h
      assert 5 + f == h
  
      h = DMP([[ZZ(-10)]], ZZ)
  
      assert f.sub(g) == h
      assert f - g == h
      assert g - f == -h
      assert f - 5 == h
      assert 5 - f == -h
  
      h = DMP([[ZZ(-25)]], ZZ)
  
      assert f.mul(g) == h
      assert f * g == h
      assert g * f == h
      assert f * 5 == h
      assert 5 * f == h
  
      h = DMP([[ZZ(25)]], ZZ)
  
      assert f.sqr() == h
      assert f.pow(2) == h
      assert f**2 == h
  
      raises(TypeError, lambda: f.pow("x"))
  
      f = DMP([[ZZ(1)], [], [ZZ(1), ZZ(0), ZZ(0)]], ZZ)
      g = DMP([[ZZ(2)], [ZZ(-2), ZZ(0)]], ZZ)
  
      q = DMP([[ZZ(2)], [ZZ(2), ZZ(0)]], ZZ)
      r = DMP([[ZZ(8), ZZ(0), ZZ(0)]], ZZ)
  
      assert f.pdiv(g) == (q, r)
      assert f.pquo(g) == q
      assert f.prem(g) == r
  
      raises(ExactQuotientFailed, lambda: f.pexquo(g))
  
      f = DMP([[ZZ(1)], [], [ZZ(1), ZZ(0), ZZ(0)]], ZZ)
      g = DMP([[ZZ(1)], [ZZ(-1), ZZ(0)]], ZZ)
  
      q = DMP([[ZZ(1)], [ZZ(1), ZZ(0)]], ZZ)
      r = DMP([[ZZ(2), ZZ(0), ZZ(0)]], ZZ)
  
      assert f.div(g) == (q, r)
      assert f.quo(g) == q
      assert f.rem(g) == r
  
      assert divmod(f, g) == (q, r)
      assert f // g == q
      assert f % g == r
  
      raises(ExactQuotientFailed, lambda: f.exquo(g))
  
imports: from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.polys.domains import ZZ, QQ
  from sympy.polys.polyclasses import DMP, DMF, ANP
  from sympy.polys.polyerrors import CoercionFailed, ExactQuotientFailed, NotInvertible
  from sympy.polys.specialpolys import f_polys
  from sympy.testing.pytest import raises, warns_deprecated_sympy
label_desc: Use image node_id 7 for calling a global function with example usage: test_DMP_arithmetics() without return types