code: def test_DDM_str():
      sdm = SDM({0: {0: ZZ(1)}, 1: {1: ZZ(1)}}, (2, 2), ZZ)
      assert str(sdm) == "{0: {0: 1}, 1: {1: 1}}"
      if GROUND_TYPES == "gmpy":  # pragma: no cover
          assert (
              repr(sdm)
              == "SDM({0: {0: mpz(1)}, 1: {1: mpz(1)}}, (2, 2), ZZ)"
          )
      else:  # pragma: no cover
          assert repr(sdm) == "SDM({0: {0: 1}, 1: {1: 1}}, (2, 2), ZZ)"
  
imports: from itertools import product
  from sympy.core.singleton import S
  from sympy.external.gmpy import GROUND_TYPES
  from sympy.testing.pytest import raises
  from sympy.polys.domains import QQ, ZZ, EXRAW
  from sympy.polys.matrices.sdm import SDM
  from sympy.polys.matrices.ddm import DDM
  from sympy.polys.matrices.exceptions import DMBadInputError, DMDomainError, DMShapeError
label_desc: Use image node_id 2 for calling a global function with example usage: test_DDM_str() without return types