code: def test_spherical_normalization(radial_order=4, time_order=2):
      gtab_4d = generate_gtab4D()
      l1, l2, l3 = [0.0015, 0.0003, 0.0003]
      S = generate_signal_crossing(gtab_4d, l1, l2, l3)
  
      qtdmri_mod_aniso = qtdmri.QtdmriModel(
          gtab_4d,
          radial_order=radial_order,
          time_order=time_order,
          cartesian=False,
          normalization=False,
      )
      qtdmri_mod_aniso_norm = qtdmri.QtdmriModel(
          gtab_4d,
          radial_order=radial_order,
          time_order=time_order,
          cartesian=False,
          normalization=True,
      )
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          qtdmri_fit = qtdmri_mod_aniso.fit(S)
          qtdmri_fit_norm = qtdmri_mod_aniso_norm.fit(S)
          assert_array_almost_equal(
              qtdmri_fit.fitted_signal(),
              qtdmri_fit_norm.fitted_signal(),
          )
  
      rt_grid = qtdmri.create_rt_space_grid(5, 20e-3, 5, 0.02, 0.05)
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          pdf = qtdmri_fit.pdf(rt_grid)
          pdf_norm = qtdmri_fit_norm.pdf(rt_grid)
      assert_array_almost_equal(pdf / pdf.max(), pdf_norm / pdf.max())
  
      norm_laplacian = qtdmri_fit.norm_of_laplacian_signal()
      norm_laplacian_norm = qtdmri_fit_norm.norm_of_laplacian_signal()
      assert_array_almost_equal(
          norm_laplacian / norm_laplacian,
          norm_laplacian_norm / norm_laplacian,
      )
  
imports: import warnings
  import numpy
  import scipy.integrate
  from numpy.testing import assert_, assert_almost_equal, assert_array_almost_equal, assert_equal, assert_raises
  import pytest
  from dipy.core.gradients import gradient_table_from_qvals_bvecs
  from dipy.data import get_gtab_taiwan_dsi, get_sphere
  from dipy.reconst import qtdmri, mapmri
  from dipy.reconst.shm import descoteaux07_legacy_msg
  from dipy.sims.voxel import multi_tensor, add_noise
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 8 for calling a global function with example usage: test_spherical_normalization(radial_order, time_order) without return types