code: def test_errors():
      # first error raises if MeanDiffusionKurtosisModel is called for
      # data will only one non-zero b-value
      assert_raises(ValueError, msdki.MeanDiffusionKurtosisModel, gtab)
  
      # second error raises if negative signal is given to MeanDiffusionKurtosis
      # model
      assert_raises(
          ValueError,
          msdki.MeanDiffusionKurtosisModel,
          gtab_3s,
          min_signal=-1,
      )
  
      # third error raises if wrong mask is given to fit
      mask_wrong = np.ones((2, 3, 1))
      msdki_model = msdki.MeanDiffusionKurtosisModel(gtab_3s)
      assert_raises(ValueError, msdki_model.fit, DWI, mask=mask_wrong)
  
      # fourth error raises if an given index point to more dimensions that data
      # does not contain
  
      # define auxiliary function for the assert raises
      def aux_test_fun(ob, ind):
          met = ob[ind].msk
          return met
  
      mdkiF = msdki_model.fit(DWI)
      assert_raises(IndexError, aux_test_fun, mdkiF, (0, 0, 0, 0))
      # checking if aux_test_fun runs fine
      met = aux_test_fun(mdkiF, (0, 0, 0))
      assert_array_almost_equal(MKgt_multi[0, 0, 0], met)
  
      # Fifth error rises if wrong mask is given to awf_from_msk
      assert_raises(
          ValueError, awf_from_msk, MKgt_multi, mask=mask_wrong
      )
  
file_path: dipy/dipy/reconst/tests/test_msdki.py
imports: import numpy
  import random
  from numpy.testing import assert_array_almost_equal, assert_raises, assert_almost_equal, assert_
  from dipy.sims.voxel import single_tensor, multi_tensor_dki
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.core.gradients import gradient_table, unique_bvals_magnitude, round_bvals
  from dipy.data import get_fnames
  import dipy.reconst.msdki
  from dipy.reconst.msdki import msk_from_awf, awf_from_msk
label_desc: Use image node_id 4 for calling a global function with example usage: test_errors() and returns: met