code: def test_carlson_rd():
      # Define inputs that we know the outputs from:
      # Carlson, B.C., 1994. Numerical computation of real or complex
      # elliptic integrals. arXiv:math/9409227 [math.CA]
  
      # Real values
      x = np.array([0.0, 2.0])
      y = np.array([2.0, 3.0])
      z = np.array([1.0, 4.0])
  
      # Defene reference outputs
      RD_ref = np.array([1.7972103521034, 0.16510527294261])
  
      # Compute integrals
      RD = carlson_rd(x, y, z, errtol=1e-5)
  
      # Compare
      assert_array_almost_equal(RD, RD_ref)
  
      # Complex values (testing in 2D format)
      x = np.array([[1j, 0.0], [0.0, -2 - 1j]])
      y = np.array([[-1j, 1j], [1j - 1, -1j]])
      z = np.array([[2.0, -1j], [1j, -1 + 1j]])
  
      # Defene reference outputs
      RD_ref = np.array(
          [
              [0.65933854154220, 1.2708196271910 + 2.7811120159521j],
              [
                  -1.8577235439239 - 0.96193450888839j,
                  1.8249027393704 - 1.2218475784827j,
              ],
          ]
      )
      # Compute integrals
      RD = carlson_rd(x, y, z, errtol=1e-5)
  
      # Compare
      assert_array_almost_equal(RD, RD_ref)
  
imports: import numpy
  import random
  import dipy.reconst.dki
  import dipy.reconst.dti
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_almost_equal, assert_raises
  from dipy.sims.voxel import multi_tensor_dki
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.core.gradients import gradient_table
  from dipy.data import get_fnames
  from dipy.reconst.dti import from_lower_triangular, decompose_tensor
  from dipy.reconst.dki import mean_kurtosis, carlson_rf, carlson_rd, axial_kurtosis, radial_kurtosis, mean_kurtosis_tensor, _positive_evals, lower_triangular, kurtosis_fractional_anisotropy
  from dipy.core.sphere import Sphere
  from dipy.data import default_sphere
  from dipy.core.geometry import sphere2cart
  from dipy.utils.optpkg import optional_package
  from dipy.utils.tripwire import TripWireError
label_desc: Use image node_id 9 for calling a global function with example usage: test_carlson_rd() without return types