code: def streamline_tensors(streamline, evals=(0.001, 0, 0)):
      """
      The tensors generated by this fiber.
  
      Parameters
      ----------
      streamline : array-like of shape (n, 3)
          The 3d coordinates of a single streamline
  
      evals : iterable with three entries, optional
          The estimated eigenvalues of a single fiber tensor.
  
      Returns
      -------
      An n_nodes by 3 by 3 array with the tensor for each node in the fiber.
  
      Notes
      -----
      Estimates of the radial/axial diffusivities may rely on
      empirical measurements (for example, the AD in the Corpus Callosum), or
      may be based on a biophysical model of some kind.
      """
  
      grad = streamline_gradients(streamline)
  
      # Preallocate:
      tensors = np.empty((grad.shape[0], 3, 3))
  
      for grad_idx, this_grad in enumerate(grad):
          tensors[grad_idx] = grad_tensor(this_grad, evals)
      return tensors
  
imports: import numpy
  import scipy.sparse
  import scipy.linalg
  from dipy.reconst.base import ReconstModel, ReconstFit
  from dipy.tracking.utils import unique_rows
  from dipy.tracking.streamline import transform_streamlines
  from dipy.tracking.vox2track import _voxel2streamline
  import dipy.data
  import dipy.core.optimize
label_desc: Use image node_id 4 for calling a global function with example usage: streamline_tensors(streamline, evals) and returns: tensors