code: def test_convert_sh_descoteaux_tournier():
      # case: max degree zero
      sh_coeffs = np.array(
          [1.54]
      )  # there is only an l=0,m=0 coefficient
      converted_coeffs = convert_sh_descoteaux_tournier(sh_coeffs)
      assert_array_equal(converted_coeffs, sh_coeffs)
  
      # case: max degree 4
      sh_coeffs = np.array(
          [
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              14,
              15,
          ],
          dtype=float,
      )
      # expected result is that there is a swap m <--> -m
      expected_coeffs = np.array(
          [
              1,
              6,
              5,
              4,
              3,
              2,
              15,
              14,
              13,
              12,
              11,
              10,
              9,
              8,
              7,
          ],
          dtype=float,
      )
      converted_coeffs = convert_sh_descoteaux_tournier(sh_coeffs)
      assert_array_equal(converted_coeffs, expected_coeffs)
  
      # case: max degree 4 but with more axes
      dim0 = 2
      dim1 = 3
      sh_coeffs_grid = np.array(
          [np.linspace(10 * i, 10 * i + 1, 6) for i in range(6)]
      ).reshape(dim0, dim1, 6)
      converted_coeffs_grid = convert_sh_descoteaux_tournier(
          sh_coeffs_grid
      )
      assert_equal(sh_coeffs_grid.shape, converted_coeffs_grid.shape)
      for i0 in range(dim0):
          for i1 in range(dim1):
              shc = sh_coeffs_grid[
                  i0, i1
              ]  # shc is short for "sh_coeffs"
              converted_coeffs = converted_coeffs_grid[i0, i1]
              expected_coeffs = np.array(
                  [
                      shc[0],
                      shc[5],
                      shc[4],
                      shc[3],
                      shc[2],
                      shc[1],
                  ]
              )
              assert_array_equal(converted_coeffs, expected_coeffs)
  
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 25 for calling a global function with example usage: test_convert_sh_descoteaux_tournier() without return types