code: def randsphere(n, rstate=None):
      
  
      if rstate is None:
          rstate = np.random
  
      z = rstate.randn(n)  # initial n-dim vector
      zhat = z / lalg.norm(z)  # normalize
      xhat = zhat * rstate.rand()**(1./n)  # scale
  
      return xhat
docs: Draw a point uniformly within an `n`-dimensional unit sphere.