code: def test_dm_inv_den(name, A, A_inv, den):
      if den != 0:
          A_inv_f, den_f = A.inv_den()
          assert A_inv_f.cancel_denom(den_f) == A_inv.cancel_denom(den)
      else:
          raises(DMNonInvertibleMatrixError, lambda: A.inv_den())
  
file_path: sympy/sympy/polys/matrices/tests/test_inverse.py
imports: from sympy import ZZ
  from sympy.polys.matrices import DM, DomainMatrix
  from sympy.polys.matrices.dense import ddm_iinv
  from sympy.polys.matrices.exceptions import DMNonInvertibleMatrixError
  from sympy.matrices.exceptions import NonInvertibleMatrixError
  import pytest
  from sympy.testing.pytest import raises
label_desc: Use image node_id 2 for calling a global function with example usage: test_dm_inv_den(name, A, A_inv, den) without return types