code: def _dm_elements(M):
      """Return nonzero elements of a DomainMatrix."""
      elements, _ = M.to_flat_nz()
      return elements
  
file_path: sympy/sympy/polys/matrices/rref.py
imports: from sympy.polys.domains import ZZ
  from sympy.polys.matrices.sdm import SDM, sdm_irref, sdm_rref_den
  from sympy.polys.matrices.ddm import DDM
  from sympy.polys.matrices.dense import ddm_irref, ddm_irref_den
label_desc: Use image node_id 14 for calling a global function with example usage: _dm_elements(M) and returns: elements