code: def multi_tissue_basis(gtab, sh_order, iso_comp):
      """
      Builds a basis for multi-shell multi-tissue CSD model.
  
      Parameters
      ----------
      gtab : GradientTable
      sh_order : int
      iso_comp: int
          Number of tissue compartments for running the MSMT-CSD. Minimum
          number of compartments required is 2.
  
      Returns
      -------
      B : ndarray
          Matrix of the spherical harmonics model used to fit the data
      m : int ``|m| <= n``
          The order of the harmonic.
      n : int ``>= 0``
          The degree of the harmonic.
      """
      if iso_comp < 2:
          msg = (
              "Multi-tissue CSD requires at least 2 tissue compartments"
          )
          raise ValueError(msg)
      r, theta, phi = geo.cart2sphere(*gtab.gradients.T)
      m, n = shm.sph_harm_ind_list(sh_order)
      B = shm.real_sh_descoteaux_from_index(
          m, n, theta[:, None], phi[:, None]
      )
      B[np.ix_(gtab.b0s_mask, n > 0)] = 0.0
  
      iso = np.empty([B.shape[0], iso_comp])
      iso[:] = SH_CONST
  
      B = np.concatenate([iso, B], axis=1)
      return B, m, n
  
imports: from packaging.version import Version
  import numbers
  import warnings
  import numpy
  from dipy.core import geometry
  from dipy.core.gradients import GradientTable, gradient_table, unique_bvals_tolerance, get_bval_indices
  from dipy.data import default_sphere
  from dipy.reconst import shm
  from dipy.reconst.csdeconv import response_from_mask_ssst
  from dipy.reconst.dti import TensorModel, fractional_anisotropy, mean_diffusivity
  from dipy.reconst.multi_voxel import multi_voxel_fit
  from dipy.reconst.utils import _roi_in_volume, _mask_from_roi
  from dipy.sims.voxel import single_tensor
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 1 for calling a global function with example usage: multi_tissue_basis(gtab, sh_order, iso_comp) and returns: B,  m,  n