code: def test_noisy_fit():
      """
      Test fitting for noisy signals. This tests whether the threshold condition
      applies correctly and returns the linear fitting parameters.
  
      For older scipy versions, the returned value of `f` from a linear fit is
      around 135 and D and D_star values are equal. Hence doing a test based on
      Scipy version.
      """
      msg = "Bounds for this fit have been set from experiments .*"
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore", message=msg, category=UserWarning
          )
          model_one_stage = IvimModel(gtab, fit_method="trr")
  
      with warnings.catch_warnings(record=True) as w:
          fit_one_stage = model_one_stage.fit(noisy_single)
          assert_equal(len(w), 3)
          for l_w in w:
              assert_(issubclass(l_w.category, UserWarning))
          assert_("" in str(w[0].message))
          assert_(
              "x0 obtained from linear fitting is not feasible"
              in str(w[0].message)
          )
          assert_("x0 is unfeasible" in str(w[1].message))
          assert_(
              "Bounds are violated for leastsq fitting"
              in str(w[2].message)
          )
  
      assert_array_less(
          fit_one_stage.model_params, [10000.0, 0.3, 0.01, 0.001]
      )
  
imports: import warnings
  import numpy
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_raises, assert_array_less, assert_, assert_equal
  from dipy.testing import assert_greater_equal
  import pytest
  from dipy.reconst.ivim import ivim_prediction, IvimModel
  from dipy.core.gradients import gradient_table, generate_bvecs
  from dipy.sims.voxel import multi_tensor
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 15 for calling a global function with example usage: test_noisy_fit() without return types