code: def test_kurtosis_fa():
      # KFA = sqrt(4/5) if kurtosis is non-zero only in one direction
      mevals = np.array([[0.002, 0, 0], [0.003, 0, 0]])
      angles = [(45, 0), (45, 0)]
      fie = 0.5
      frac = [fie * 100, (1 - fie) * 100]
      signal, dt, kt = multi_tensor_dki(
          gtab_2s,
          mevals,
          S0=100,
          angles=angles,
          fractions=frac,
          snr=None,
      )
  
      dkiM = dki.DiffusionKurtosisModel(gtab_2s)
      dkiF = dkiM.fit(signal)
      assert_almost_equal(dkiF.kfa, np.sqrt(4 / 5))
  
      # KFA = sqrt(13/5) for systems of two tensors with same AD and RD values
      # See appendix of Gleen et al., 2015 Quantitative assessment of diffusional
      # kurtosis anisotropy. NMR Biomed 28; 448-459. doi:10.1002/nbm.3271
      mevals = np.array([[0.003, 0.001, 0.001], [0.003, 0.001, 0.001]])
      angles = [(40, -10), (-45, 10)]
      fie = 0.5
      frac = [fie * 100, (1 - fie) * 100]
      signal, dt, kt = multi_tensor_dki(
          gtab_2s,
          mevals,
          S0=100,
          angles=angles,
          fractions=frac,
          snr=None,
      )
  
      dkiM = dki.DiffusionKurtosisModel(gtab_2s)
      dkiF = dkiM.fit(signal)
      assert_almost_equal(dkiF.kfa, np.sqrt(13 / 15))
  
      # KFA = 0 if MKT = 0
      mevals = np.array([[0.003, 0.001, 0.001], [0.003, 0.001, 0.001]])
      angles = [(40, -10), (40, -10)]
      fie = 0.5
      frac = [fie * 100, (1 - fie) * 100]
      signal, dt, kt = multi_tensor_dki(
          gtab_2s,
          mevals,
          S0=100,
          angles=angles,
          fractions=frac,
          snr=None,
      )
  
      dkiM = dki.DiffusionKurtosisModel(gtab_2s)
      dkiF = dkiM.fit(signal)
      assert_almost_equal(dkiF.kfa, 0)
  
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 21 for calling a global function with example usage: test_kurtosis_fa() without return types