code: def test_mapmri_isotropic_static_scale_factor(
      radial_order=6, rng=None
  ):
      gtab = get_gtab_taiwan_dsi()
      D = 0.7e-3
      tau = 1 / (4 * np.pi**2)
      mu = np.sqrt(D * 2 * tau)
  
      l1, l2, l3 = [D, D, D]
      S = single_tensor(gtab, evals=np.r_[l1, l2, l3], rng=rng)
      S_array = np.tile(S, (5, 1))
  
      stat_weight = 0.1
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          mapm_scale_stat_reg_stat = MapmriModel(
              gtab,
              radial_order=radial_order,
              anisotropic_scaling=False,
              dti_scale_estimation=False,
              static_diffusivity=D,
              laplacian_regularization=True,
              laplacian_weighting=stat_weight,
          )
          mapm_scale_adapt_reg_stat = MapmriModel(
              gtab,
              radial_order=radial_order,
              anisotropic_scaling=False,
              dti_scale_estimation=True,
              laplacian_regularization=True,
              laplacian_weighting=stat_weight,
          )
  
      start = time.time()
      mapf_scale_stat_reg_stat = mapm_scale_stat_reg_stat.fit(S_array)
      time_scale_stat_reg_stat = time.time() - start
  
      start = time.time()
      mapf_scale_adapt_reg_stat = mapm_scale_adapt_reg_stat.fit(S_array)
      time_scale_adapt_reg_stat = time.time() - start
  
      # test if indeed the scale factor is fixed now
      assert_equal(np.all(mapf_scale_stat_reg_stat.mu == mu), True)
  
      # test if computation time is shorter (except on Windows):
      if not platform.system() == "Windows":
          assert_equal(
              time_scale_stat_reg_stat < time_scale_adapt_reg_stat,
              True,
              "mapf_scale_stat_reg_stat ({0}s) slower than "
              "mapf_scale_adapt_reg_stat ({1}s). It should be the"
              " opposite.".format(
                  time_scale_stat_reg_stat, time_scale_adapt_reg_stat
              ),
          )
  
      # check if the fitted signal is the same
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          assert_almost_equal(
              mapf_scale_stat_reg_stat.fitted_signal(),
              mapf_scale_adapt_reg_stat.fitted_signal(),
          )
  
imports: import platform
  import time
  from math import factorial
  from scipy.special import gamma
  import scipy.integrate
  import warnings
  import numpy
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal, assert_, assert_raises
  import pytest
  from dipy.core.sphere_stats import angular_similarity
  from dipy.core.subdivide_octahedron import create_unit_sphere
  from dipy.data import get_gtab_taiwan_dsi, default_sphere
  from dipy.direction.peaks import peak_directions
  from dipy.reconst.mapmri import MapmriModel, mapmri_index_matrix
  from dipy.reconst import dti, mapmri
  from dipy.reconst.odf import gfa
  from dipy.reconst.tests.test_dsi import sticks_and_ball_dummies
  from dipy.reconst.shm import sh_to_sf, descoteaux07_legacy_msg
  from dipy.sims.voxel import multi_tensor, multi_tensor_pdf, add_noise, single_tensor, cylinders_and_ball_soderman
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 9 for calling a global function with example usage: test_mapmri_isotropic_static_scale_factor(radial_order, rng) without return types