code: def test_nullspace_second():
      # first test reduced row-ech form
      R = Rational
  
      M = Matrix([[5, 7, 2, 1], [1, 6, 2, -1]])
      out, tmp = M.rref()
      assert out == Matrix(
          [
              [1, 0, -R(2) / 23, R(13) / 23],
              [0, 1, R(8) / 23, R(-6) / 23],
          ]
      )
  
      M = Matrix(
          [
              [-5, -1, 4, -3, -1],
              [1, -1, -1, 1, 0],
              [-1, 0, 0, 0, 0],
              [4, 1, -4, 3, 1],
              [-2, 0, 2, -2, -1],
          ]
      )
      assert M * M.nullspace()[0] == Matrix(5, 1, [0] * 5)
  
      M = Matrix(
          [
              [1, 3, 0, 2, 6, 3, 1],
              [-2, -6, 0, -2, -8, 3, 1],
              [3, 9, 0, 0, 6, 6, 2],
              [-1, -3, 0, 1, 0, 9, 3],
          ]
      )
      out, tmp = M.rref()
      assert out == Matrix(
          [
              [1, 3, 0, 0, 2, 0, 0],
              [0, 0, 0, 1, 2, 0, 0],
              [0, 0, 0, 0, 0, 1, R(1) / 3],
              [0, 0, 0, 0, 0, 0, 0],
          ]
      )
  
      # now check the vectors
      basis = M.nullspace()
      assert basis[0] == Matrix([-3, 1, 0, 0, 0, 0, 0])
      assert basis[1] == Matrix([0, 0, 1, 0, 0, 0, 0])
      assert basis[2] == Matrix([-2, 0, 0, -2, 1, 0, 0])
      assert basis[3] == Matrix([0, 0, 0, 0, 0, R(-1) / 3, 1])
  
      # issue 4797; just see that we can do it when rows > cols
      M = Matrix([[1, 2], [2, 4], [3, 6]])
      assert M.nullspace()
  
file_path: sympy/sympy/matrices/tests/test_subspaces.py
imports: from sympy.matrices import Matrix
  from sympy.core.numbers import Rational
  from sympy.core.symbol import symbols
  from sympy.solvers import solve
label_desc: Use image node_id 4 for calling a global function with example usage: test_nullspace_second() without return types