code: def params_to_btens(bval, bdelta, b_eta):
      """Compute b-tensor from trace, anisotropy and asymmetry parameters.
  
      Parameters
      ----------
      bval: int or float
          b-value (>= 0)
      bdelta: int or float
          normalized tensor anisotropy (>= -0.5 and <= 1)
      b_eta: int or float
          tensor asymmetry (>= 0 and <= 1)
  
      Returns
      -------
      (3, 3) numpy.ndarray
          output b-tensor
  
      Notes
      -----
      Implements eq. 7.11. p. 231 in [1].
  
      References
      ----------
      .. [1] D. Topgaard, NMR methods for studying microscopic diffusion
      anisotropy, in: R. Valiullin (Ed.), Diffusion NMR of Confined Systems: Fluid
      Transport in Porous Solids and Heterogeneous Materials, Royal Society of
      Chemistry, Cambridge, UK, 2016.
  
      """
  
      # Check input times are OK
      expected_input_types = (float, int)
      input_types_all_ok = (
          isinstance(bval, expected_input_types)
          and isinstance(bdelta, expected_input_types)
          and isinstance(b_eta, expected_input_types)
      )
  
      if not input_types_all_ok:
          s = [x.__name__ for x in expected_input_types]
          it_msg = "All input types should any of: {}".format(s)
          raise ValueError(it_msg)
  
      # Check input values within expected ranges
      if bval < 0:
          raise ValueError("`bval` must be >= 0")
  
      if not -0.5 <= bdelta <= 1:
          raise ValueError("`delta` must be >= -0.5 and <= 1")
  
      if not 0 <= b_eta <= 1:
          raise ValueError("`b_eta` must be >= 0 and <= 1")
  
      m1 = np.array([[-1, 0, 0], [0, -1, 0], [0, 0, 2]])
      m2 = np.array([[-1, 0, 0], [0, 1, 0], [0, 0, 0]])
      btens = bval / 3 * (np.eye(3) + bdelta * (m1 + b_eta * m2))
  
      return btens
  
imports: import logging
  from warnings import warn
  import numpy
  from scipy.linalg import inv, polar
  from dipy.io import gradients
  from dipy.core.onetime import auto_attr
  from dipy.core.geometry import vector_norm, vec2vec_rotmat
  from dipy.core.sphere import disperse_charges, HemiSphere
  from dipy.utils.deprecator import deprecate_with_version
label_desc: Use image node_id 18 for calling a global function with example usage: params_to_btens(bval, bdelta, b_eta) and returns: btens