code: def test_real_sh_descoteaux2():
      vertices = hemi_icosahedron.subdivide(2).vertices
      mevals = np.array(
          [[0.0015, 0.0003, 0.0003], [0.0015, 0.0003, 0.0003]]
      )
      angles = [(0, 0), (60, 0)]
      odf = multi_tensor_odf(vertices, mevals, angles, [50, 50])
  
      mevals = np.array([[0.0015, 0.0003, 0.0003]])
      angles = [(0, 0)]
      odf2 = multi_tensor_odf(-vertices, mevals, angles, [100])
  
      sphere = Sphere(xyz=np.vstack((vertices, -vertices)))
      # Asymmetric spherical function with 162 coefficients
      sf = np.append(odf, odf2)
  
      # In order for our approximation to be precise enough, we
      # will use a SH basis of orders up to 10 (121 coefficients)
  
      with warnings.catch_warnings(record=True) as w:
          B, m, n = real_sh_descoteaux(
              10, sphere.theta, sphere.phi, full_basis=True
          )
  
      npt.assert_equal(len(w), 1)
      npt.assert_(issubclass(w[0].category, PendingDeprecationWarning))
      npt.assert_(descoteaux07_legacy_msg in str(w[0].message))
  
      invB = smooth_pinv(B, L=np.zeros_like(n))
      sh_coefs = np.dot(invB, sf)
      sf_approx = np.dot(B, sh_coefs)
  
      assert_array_almost_equal(sf_approx, sf, 2)
  
imports: import warnings
  import numpy
  import numpy.linalg
  import numpy.testing
  from dipy.testing import assert_true
  from numpy.testing import assert_array_equal, assert_array_almost_equal, assert_equal, assert_raises
  from scipy.special import sph_harm
  from dipy.core.sphere import hemi_icosahedron, Sphere
  from dipy.core.gradients import gradient_table
  from dipy.core.interpolation import NearestNeighborInterpolator
  from dipy.sims.voxel import single_tensor
  from dipy.direction.peaks import peak_directions
  from dipy.reconst.shm import sf_to_sh, sh_to_sf
  from dipy.sims.voxel import multi_tensor_odf
  from dipy.data import mrtrix_spherical_functions
  from dipy.reconst import odf
  from dipy.reconst.shm import real_sh_descoteaux_from_index, real_sym_sh_basis, real_sym_sh_mrtrix, real_sh_descoteaux, real_sh_tournier, sph_harm_ind_list, order_from_ncoef, OpdtModel, normalize_data, hat, lcr_matrix, smooth_pinv, bootstrap_data_array, bootstrap_data_voxel, ResidualBootstrapWrapper, CsaOdfModel, QballModel, SphHarmFit, spherical_harmonics, anisotropic_power, calculate_max_order, sh_to_sf_matrix, gen_dirac, convert_sh_to_full_basis, convert_sh_from_legacy, convert_sh_to_legacy, convert_sh_descoteaux_tournier, descoteaux07_legacy_msg, tournier07_legacy_msg
label_desc: Use image node_id 9 for calling a global function with example usage: test_real_sh_descoteaux2() without return types