code: def generate_bvecs(N, iters=5000, rng=None):
      """Generates N bvectors.
  
      Uses dipy.core.sphere.disperse_charges to model electrostatic repulsion on
      a unit sphere.
  
      Parameters
      ----------
      N : int
          The number of bvectors to generate. This should be equal to the number
          of bvals used.
      iters : int
          Number of iterations to run.
      rng : numpy.random.Generator, optional
          Numpy's random number generator. If None, the generator is created.
          Default is None.
  
      Returns
      -------
      bvecs : (N,3) ndarray
          The generated directions, represented as a unit vector, of each
          gradient.
      """
      if rng is None:
          rng = np.random.default_rng()
      theta = np.pi * rng.random(N)
      phi = 2 * np.pi * rng.random(N)
      hsph_initial = HemiSphere(theta=theta, phi=phi)
      hsph_updated, potential = disperse_charges(hsph_initial, iters)
      bvecs = hsph_updated.vertices
      return bvecs
  
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 10 for calling a global function with example usage: generate_bvecs(N, iters, rng) and returns: bvecs