code: def random_uniform_on_sphere(n=1, coords="xyz"):
      r"""Random unit vectors from a uniform distribution on the sphere.
  
      Parameters
      ----------
      n : int
          Number of random vectors
      coords : {'xyz', 'radians', 'degrees'}
          'xyz' for cartesian form
          'radians' for spherical form in rads
          'degrees' for spherical form in degrees
  
      Notes
      -----
      The uniform distribution on the sphere, parameterized by spherical
      coordinates $(\theta, \phi)$, should verify $\phi\sim U[0,2\pi]$, while
      $z=\cos(\theta)\sim U[-1,1]$.
  
      References
      ----------
      .. [1] https://mathworld.wolfram.com/SpherePointPicking.html.
  
      Returns
      -------
      X : array, shape (n,3) if coords='xyz' or shape (n,2) otherwise
          Uniformly distributed vectors on the unit sphere.
  
      Examples
      --------
      >>> from dipy.core.sphere_stats import random_uniform_on_sphere
      >>> X = random_uniform_on_sphere(4, 'radians')
      >>> X.shape == (4, 2)
      True
      >>> X = random_uniform_on_sphere(4, 'xyz')
      >>> X.shape == (4, 3)
      True
      """
      rng = np.random.default_rng()
      z = rng.uniform(-1, 1, n)
      theta = np.arccos(z)
      phi = rng.uniform(0, 2 * np.pi, n)
      if coords == "xyz":
          r = np.ones(n)
          return np.vstack(geometry.sphere2cart(r, theta, phi)).T
      angles = np.vstack((theta, phi)).T
      if coords == "radians":
          return angles
      if coords == "degrees":
          return np.rad2deg(angles)
  
imports: import numpy
  import dipy.core.geometry
  from itertools import permutations
label_desc: Use image node_id 1 for calling a global function with example usage: random_uniform_on_sphere(n, coords) and returns: np, angles, np