code: def _divide_last(null):
      """Normalize the nullspace by the rightmost non-zero entry."""
      null = null.to_field()
  
      if null.is_zero_matrix:
          return null
  
      rows = []
      for i in range(null.shape[0]):
          for j in reversed(range(null.shape[1])):
              if null[i, j]:
                  rows.append(null[i, :] / null[i, j])
                  break
          else:
              assert False  # pragma: no cover
  
      return DomainMatrix.vstack(*rows)
  
file_path: sympy/sympy/polys/matrices/tests/test_nullspace.py
imports: from sympy import ZZ, Matrix
  from sympy.polys.matrices import DM, DomainMatrix
  from sympy.polys.matrices.ddm import DDM
  from sympy.polys.matrices.sdm import SDM
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: _divide_last(null) and returns: DomainMatrix, null