code: def test_full_rank():
      rng = np.random.RandomState(20110831)
      X = rng.standard_normal((40, 5))
      # A quick rank check
      assert matrix_rank(X) == 5
      X[:, 0] = X[:, 1] + X[:, 2]
      assert matrix_rank(X) == 4
      Y1 = full_rank(X)
      assert Y1.shape == (40, 4)
      Y2 = full_rank(X, r=3)
      assert Y2.shape == (40, 3)
      Y3 = full_rank(X, r=4)
      assert Y3.shape == (40, 4)
      # Windows - there seems to be some randomness in the SVD result; standardize
      # column signs before comparison
      flipper = np.sign(Y1[0]) * np.sign(Y3[0])
      assert_almost_equal(Y1, Y3 * flipper)
  
file_path: nipy/nipy/algorithms/utils/tests/test_matrices.py
imports: import numpy
  import scipy.linalg
  from numpy.testing import assert_almost_equal, assert_array_almost_equal
  from ..matrices import full_rank, matrix_rank, pos_recipr, recipr0
label_desc: Use image node_id 2 for calling a global function with example usage: test_full_rank() without return types