code: def multi_tensor(
      gtab,
      mevals,
      S0=1.0,
      angles=((0, 0), (90, 0)),
      fractions=(50, 50),
      snr=20,
      rng=None,
  ):
      r"""Simulate a Multi-Tensor signal.
  
      Parameters
      ----------
      gtab : GradientTable
          Table with information of b-values and gradient directions.
          Note that if gtab has a btens attribute, simulations will be performed
          according to the given b-tensor information.
      mevals : array (K, 3)
          each tensor's eigenvalues in each row
      S0 : float, optional
          Unweighted signal value (b0 signal).
      angles : array (K, 2) or (K, 3), optional
          List of K tensor directions in polar angles (in degrees) or unit
          vectors
      fractions : array-like, optional
          Percentage of the contribution of each tensor. The sum of fractions
          should be equal to 100%.
      snr : float, optional
          Signal to noise ratio, assuming Rician noise.  If set to None, no
          noise is added.
  
      Returns
      -------
      S : (N,) ndarray
          Simulated signal.
      sticks : (M,3)
          Sticks in cartesian coordinates.
  
      Examples
      --------
      >>> import numpy as np
      >>> from dipy.sims.voxel import multi_tensor
      >>> from dipy.data import get_fnames
      >>> from dipy.core.gradients import gradient_table
      >>> from dipy.io.gradients import read_bvals_bvecs
      >>> fimg, fbvals, fbvecs = get_fnames('small_101D')
      >>> bvals, bvecs = read_bvals_bvecs(fbvals, fbvecs)
      >>> gtab = gradient_table(bvals, bvecs)
      >>> mevals=np.array(([0.0015, 0.0003, 0.0003],[0.0015, 0.0003, 0.0003]))
      >>> e0 = np.array([1, 0, 0.])
      >>> e1 = np.array([0., 1, 0])
      >>> S = multi_tensor(gtab, mevals)
  
      """
      if rng is None:
          rng = np.random.default_rng()
  
      if np.round(np.sum(fractions), 2) != 100.0:
          raise ValueError("Fractions should sum to 100")
  
      fractions = [f / 100.0 for f in fractions]
  
      S = np.zeros(len(gtab.bvals))
  
      sticks = _check_directions(angles)
  
      for i in range(len(fractions)):
          S = S + fractions[i] * single_tensor(
              gtab,
              S0=S0,
              evals=mevals[i],
              evecs=all_tensor_evecs(sticks[i]),
              snr=None,
          )
  
      return add_noise(S, snr, S0, rng=rng), sticks
  
imports: import numpy
  from numpy import dot
  from dipy.core.geometry import sphere2cart
  from dipy.core.geometry import vec2vec_rotmat
  from dipy.core.gradients import GradientTable
  from dipy.reconst.utils import dki_design_matrix
  from scipy.special import jn
label_desc: Use image node_id 11 for calling a global function with example usage: multi_tensor(gtab, mevals, S0, angles, fractions, snr, rng) and returns: add_noise,  sticks