code: def _rref_dm(dM):
      """Compute the reduced row echelon form of a DomainMatrix."""
      K = dM.domain
  
      if K.is_ZZ:
          dM_rref, den, pivots = dM.rref_den(keep_domain=False)
          dM_rref = dM_rref.to_field() / den
      elif K.is_QQ:
          dM_rref, pivots = dM.rref()
      else:
          assert False  # pragma: no cover
  
      M_rref = dM_rref.to_Matrix()
  
      return M_rref, pivots
  
file_path: sympy/sympy/matrices/reductions.py
imports: from types import FunctionType
  from sympy.polys.polyerrors import CoercionFailed
  from sympy.polys.domains import ZZ, QQ
  from .utilities import _get_intermediate_simp, _iszero, _dotprodsimp, _simplify
  from .determinant import _find_reasonable_pivot
label_desc: Use image node_id 7 for calling a global function with example usage: _rref_dm(dM) and returns: M_rref,  pivots