code: def test_DDM_charpoly():
      A = DDM([], (0, 0), ZZ)
      assert A.charpoly() == [ZZ(1)]
  
      A = DDM(
          [
              [ZZ(1), ZZ(2), ZZ(3)],
              [ZZ(4), ZZ(5), ZZ(6)],
              [ZZ(7), ZZ(8), ZZ(9)],
          ],
          (3, 3),
          ZZ,
      )
      Avec = [ZZ(1), ZZ(-15), ZZ(-18), ZZ(0)]
      assert A.charpoly() == Avec
  
      A = DDM([[ZZ(1), ZZ(2)]], (1, 2), ZZ)
      raises(DMShapeError, lambda: A.charpoly())
  
imports: from sympy.testing.pytest import raises
  from sympy.external.gmpy import GROUND_TYPES
  from sympy.polys import ZZ, QQ
  from sympy.polys.matrices.ddm import DDM
  from sympy.polys.matrices.exceptions import DMShapeError, DMNonInvertibleMatrixError, DMDomainError, DMBadInputError
label_desc: Use image node_id 26 for calling a global function with example usage: test_DDM_charpoly() without return types