code: def test_dki_fits():
      """DKI fits are tested on noise free crossing fiber simulates"""
  
      # OLS fitting
      dkiM = dki.DiffusionKurtosisModel(gtab_2s, fit_method="OLS")
      dkiF = dkiM.fit(signal_cross)
  
      assert_array_almost_equal(dkiF.model_params, crossing_ref)
  
      # WLS fitting
      dki_wlsM = dki.DiffusionKurtosisModel(gtab_2s, fit_method="WLS")
      dki_wlsF = dki_wlsM.fit(signal_cross)
  
      assert_array_almost_equal(dki_wlsF.model_params, crossing_ref)
  
      if have_cvxpy:
          # CLS fitting
          dki_clsM = dki.DiffusionKurtosisModel(
              gtab_2s, fit_method="CLS", cvxpy_solver=cvxpy.CLARABEL
          )
          dki_clsF = dki_clsM.fit(signal_cross)
  
          assert_array_almost_equal(dki_clsF.model_params, crossing_ref)
  
          # CWLS fitting
          dki_cwlsM = dki.DiffusionKurtosisModel(
              gtab_2s, fit_method="CWLS", cvxpy_solver=cvxpy.CLARABEL
          )
          dki_cwlsF = dki_cwlsM.fit(signal_cross)
  
          assert_array_almost_equal(
              dki_cwlsF.model_params, crossing_ref
          )
      else:
          assert_raises(
              TripWireError,
              dki.DiffusionKurtosisModel,
              gtab_2s,
              fit_method="CLS",
          )
          assert_raises(
              TripWireError,
              dki.DiffusionKurtosisModel,
              gtab_2s,
              fit_method="CWLS",
          )
  
      # NLS fitting
      dki_nlsM = dki.DiffusionKurtosisModel(gtab_2s, fit_method="NLS")
      dki_nlsF = dki_nlsM.fit(signal_cross)
  
      assert_array_almost_equal(dki_nlsF.model_params, crossing_ref)
  
      # Restore fitting
      dki_rtM = dki.DiffusionKurtosisModel(
          gtab_2s, fit_method="RT", sigma=2
      )
      dki_rtF = dki_rtM.fit(signal_cross)
  
      assert_array_almost_equal(dki_rtF.model_params, crossing_ref)
  
      # testing multi-voxels
      dkiF_multi = dkiM.fit(DWI)
      assert_array_almost_equal(dkiF_multi.model_params, multi_params)
  
      dkiF_multi = dki_wlsM.fit(DWI)
      assert_array_almost_equal(dkiF_multi.model_params, multi_params)
  
      dkiF_multi = dki_rtM.fit(DWI)
      assert_array_almost_equal(dkiF_multi.model_params, multi_params)
  
imports: import numpy
  import random
  import dipy.reconst.dki
  import dipy.reconst.dti
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_almost_equal, assert_raises
  from dipy.sims.voxel import multi_tensor_dki
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.core.gradients import gradient_table
  from dipy.data import get_fnames
  from dipy.reconst.dti import from_lower_triangular, decompose_tensor
  from dipy.reconst.dki import mean_kurtosis, carlson_rf, carlson_rd, axial_kurtosis, radial_kurtosis, mean_kurtosis_tensor, _positive_evals, lower_triangular, kurtosis_fractional_anisotropy
  from dipy.core.sphere import Sphere
  from dipy.data import default_sphere
  from dipy.core.geometry import sphere2cart
  from dipy.utils.optpkg import optional_package
  from dipy.utils.tripwire import TripWireError
label_desc: Use image node_id 5 for calling a global function with example usage: test_dki_fits() without return types