code: def get_bval_indices(bvals, bval, tol=20):
      """
      Get indices where the b-value is `bval`
  
      Parameters
      ----------
      bvals: ndarray
          Array containing the b-values
  
      bval: float or int
          b-value to extract indices
  
      tol: int
          The tolerated gap between the b-values to extract
          and the actual b-values.
  
      Returns
      -------
      Array of indices where the b-value is `bval`
      """
      return np.where(
          np.logical_and(bvals <= bval + tol, bvals >= bval - tol)
      )[0]
  
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 13 for calling a global function with example usage: get_bval_indices(bvals, bval, tol) and returns: np