code: def test_forecast_indices():
      # check anisotropic tensor
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          fm = ForecastModel(
              data.gtab,
              sh_order=2,
              lambda_lb=data.lambda_lb,
              dec_alg="WLS",
          )
      f_fit = fm.fit(data.S)
  
      d_par = f_fit.dpar
      d_perp = f_fit.dperp
  
      assert_almost_equal(d_par, data.mevals[0, 0], 5)
      assert_almost_equal(d_perp, data.mevals[0, 1], 5)
  
      gt_fa = np.sqrt(
          0.5
          * (2 * (data.mevals[0, 0] - data.mevals[0, 1]) ** 2)
          / (data.mevals[0, 0] ** 2 + 2 * data.mevals[0, 1] ** 2)
      )
      gt_md = (data.mevals[0, 0] + 2 * data.mevals[0, 1]) / 3.0
  
      assert_almost_equal(f_fit.fractional_anisotropy(), gt_fa, 2)
      assert_almost_equal(f_fit.mean_diffusivity(), gt_md, 5)
  
      # check isotropic tensor
      mevals = np.array(([0.003, 0.003, 0.003], [0.003, 0.003, 0.003]))
      data.angl = [(0, 0), (60, 0)]
      S, sticks = multi_tensor(
          data.gtab,
          mevals,
          S0=100.0,
          angles=data.angl,
          fractions=[50, 50],
          snr=None,
      )
  
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          fm = ForecastModel(
              data.gtab,
              sh_order=data.sh_order,
              lambda_lb=data.lambda_lb,
              dec_alg="WLS",
          )
      f_fit = fm.fit(S)
  
      d_par = f_fit.dpar
      d_perp = f_fit.dperp
  
      assert_almost_equal(d_par, 3e-03, 5)
      assert_almost_equal(d_perp, 3e-03, 5)
      assert_almost_equal(f_fit.fractional_anisotropy(), 0.0, 5)
      assert_almost_equal(f_fit.mean_diffusivity(), 3e-03, 10)
  
file_path: dipy/dipy/reconst/tests/test_forecast.py
imports: import warnings
  import numpy
  from dipy.data import get_sphere, default_sphere, get_3shell_gtab
  from dipy.reconst.forecast import ForecastModel
  from dipy.reconst.shm import descoteaux07_legacy_msg
  from dipy.sims.voxel import multi_tensor
  from numpy.testing import assert_almost_equal, assert_equal
  import pytest
  from dipy.direction.peaks import peak_directions
  from dipy.core.sphere_stats import angular_similarity
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 5 for calling a global function with example usage: test_forecast_indices() without return types