code: def test_XXM_from_list(DM):
      T = type(DM([[0]]))
  
      lol = [[1, 2, 4], [4, 5, 6]]
      lol_ZZ = [[ZZ(1), ZZ(2), ZZ(4)], [ZZ(4), ZZ(5), ZZ(6)]]
      lol_ZZ_bad = [[ZZ(1), ZZ(2), ZZ(4)], [ZZ(4), ZZ(5), ZZ(6), ZZ(7)]]
  
      assert T.from_list(lol_ZZ, (2, 3), ZZ) == DM(lol)
      raises(
          DMBadInputError, lambda: T.from_list(lol_ZZ_bad, (3, 2), ZZ)
      )
  
imports: from sympy.external.gmpy import GROUND_TYPES
  from sympy import ZZ, QQ, GF, ZZ_I, symbols
  from sympy.polys.matrices.exceptions import DMBadInputError, DMDomainError, DMNonSquareMatrixError, DMNonInvertibleMatrixError, DMShapeError
  from sympy.polys.matrices.domainmatrix import DM, DomainMatrix, DDM, SDM, DFM
  from sympy.testing.pytest import raises, skip
  import pytest
label_desc: Use image node_id 22 for calling a global function with example usage: test_XXM_from_list(DM) without return types