<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def randsphere(n, rstate=None):
 """Draw a point uniformly within an `n`-dimensional unit sphere."""


    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