code: def test_nonnegativeleastsquares(rng):
      n = 100
      X = np.eye(n)
      beta = rng.random(n)
      y = np.dot(X, beta)
      my_nnls = opt.NonNegativeLeastSquares()
      my_nnls.fit(X, y)
      npt.assert_equal(my_nnls.coef_, beta)
      npt.assert_equal(my_nnls.predict(X), y)
  
file_path: dipy/dipy/core/tests/test_optimize.py
imports: import numpy
  import scipy.sparse
  import numpy.testing
  from dipy.core.optimize import Optimizer, sparse_nnls, spdot
  import dipy.core.optimize
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 5 for calling a global function with example usage: test_nonnegativeleastsquares(rng) without return types