code: def test_DDM_rref():
      A = DDM([], (0, 4), QQ)
      assert A.rref() == (A, [])
  
      A = DDM([[QQ(0), QQ(1)], [QQ(1), QQ(1)]], (2, 2), QQ)
      Ar = DDM([[QQ(1), QQ(0)], [QQ(0), QQ(1)]], (2, 2), QQ)
      pivots = [0, 1]
      assert A.rref() == (Ar, pivots)
  
      A = DDM(
          [[QQ(1), QQ(2), QQ(1)], [QQ(3), QQ(4), QQ(1)]], (2, 3), QQ
      )
      Ar = DDM(
          [[QQ(1), QQ(0), QQ(-1)], [QQ(0), QQ(1), QQ(1)]], (2, 3), QQ
      )
      pivots = [0, 1]
      assert A.rref() == (Ar, pivots)
  
      A = DDM(
          [[QQ(3), QQ(4), QQ(1)], [QQ(1), QQ(2), QQ(1)]], (2, 3), QQ
      )
      Ar = DDM(
          [[QQ(1), QQ(0), QQ(-1)], [QQ(0), QQ(1), QQ(1)]], (2, 3), QQ
      )
      pivots = [0, 1]
      assert A.rref() == (Ar, pivots)
  
      A = DDM(
          [[QQ(1), QQ(0)], [QQ(1), QQ(3)], [QQ(0), QQ(1)]], (3, 2), QQ
      )
      Ar = DDM(
          [[QQ(1), QQ(0)], [QQ(0), QQ(1)], [QQ(0), QQ(0)]], (3, 2), QQ
      )
      pivots = [0, 1]
      assert A.rref() == (Ar, pivots)
  
      A = DDM(
          [[QQ(1), QQ(0), QQ(1)], [QQ(3), QQ(0), QQ(1)]], (2, 3), QQ
      )
      Ar = DDM(
          [[QQ(1), QQ(0), QQ(0)], [QQ(0), QQ(0), QQ(1)]], (2, 3), QQ
      )
      pivots = [0, 2]
      assert A.rref() == (Ar, pivots)
  
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 19 for calling a global function with example usage: test_DDM_rref() without return types