code: def test_mcsd_model_delta():
      sh_order = 8
      gtab = get_3shell_gtab()
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=shm.descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          response = multi_shell_fiber_response(
              sh_order,
              [0, 1000, 2000, 3500],
              wm_response,
              gm_response,
              csf_response,
          )
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=shm.descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          model = MultiShellDeconvModel(gtab, response)
      iso = response.iso
  
      theta, phi = default_sphere.theta, default_sphere.phi
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=shm.descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          B = shm.real_sh_descoteaux_from_index(
              response.m, response.n, theta[:, None], phi[:, None]
          )
  
      wm_delta = model.delta.copy()
      # set isotropic components to zero
      wm_delta[:iso] = 0.0
      wm_delta = _expand(model.m, iso, wm_delta)
  
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=shm.descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          for i, s in enumerate([0, 1000, 2000, 3500]):
              g = GradientTable(default_sphere.vertices * s)
              signal = model.predict(wm_delta, g)
              expected = np.dot(response.response[i, iso:], B.T)
              npt.assert_array_almost_equal(signal, expected)
  
      with warnings.catch_warnings():
          warnings.filterwarnings(
              "ignore",
              message=shm.descoteaux07_legacy_msg,
              category=PendingDeprecationWarning,
          )
          signal = model.predict(wm_delta, gtab)
      fit = model.fit(signal)
      m = model.m
      npt.assert_array_almost_equal(fit.shm_coeff[m != 0], 0.0, 2)
  
imports: import warnings
  from dipy.reconst.mcsd import mask_for_response_msmt, response_from_mask_msmt, auto_response_msmt
  from dipy.reconst.mcsd import MultiShellDeconvModel, multi_shell_fiber_response
  import numpy
  import numpy.testing
  import pytest
  from dipy.sims.voxel import single_tensor, multi_tensor, add_noise
  from dipy.reconst import shm
  from dipy.data import default_sphere, get_3shell_gtab
  from dipy.core.gradients import GradientTable
  from dipy.testing.decorators import set_random_number_generator
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 3 for calling a global function with example usage: test_mcsd_model_delta() without return types