code: def test_round_bvals():
      bvals_gt = np.array(
          [1000, 1000, 1000, 1000, 2000, 2000, 2000, 2000, 0]
      )
      b = round_bvals(bvals_gt)
      npt.assert_array_almost_equal(bvals_gt, b)
  
      bvals = np.array([995, 995, 995, 995, 2005, 2005, 2005, 2005, 0])
      # We don't consider differences this small to be sufficient:
      b = round_bvals(bvals)
      npt.assert_array_almost_equal(bvals_gt, b)
  
      # Unless you specify that you are interested in this magnitude of changes:
      b = round_bvals(bvals, bmag=0)
      npt.assert_array_almost_equal(bvals, b)
  
      # Case that b-values are in ms/um2
      bvals = np.array(
          [0.995, 0.995, 0.995, 0.995, 2.005, 2.005, 2.005, 2.005, 0]
      )
      b = round_bvals(bvals)
      bvals_gt = np.array([1, 1, 1, 1, 2, 2, 2, 2, 0])
      npt.assert_array_almost_equal(bvals_gt, b)
  
imports: import warnings
  import numpy
  import numpy.testing
  import pytest
  from dipy.data import get_fnames
  from dipy.core.gradients import b0_threshold_empty_gradient_message, b0_threshold_update_slicing_message, gradient_table, GradientTable, gradient_table_from_bvals_bvecs, gradient_table_from_qvals_bvecs, gradient_table_from_gradient_strength_bvecs, WATER_GYROMAGNETIC_RATIO, mask_non_weighted_bvals, orientation_to_string, reorient_bvecs, generate_bvecs, check_multi_b, round_bvals, get_bval_indices, unique_bvals_magnitude, unique_bvals_tolerance, unique_bvals, params_to_btens, btens_to_params, orientation_from_string, reorient_vectors
  from dipy.core.geometry import vec2vec_rotmat, vector_norm
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.utils.deprecator import ExpiredDeprecationError
  from dipy.testing import clear_and_catch_warnings
  from dipy.testing.decorators import set_random_number_generator
label_desc: Use image node_id 17 for calling a global function with example usage: test_round_bvals() without return types