<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def vector_unit_nullrand(v, rng=None):
 """Return unit vectors. Any null vectors are mapped to a uniformly picked unit vector. Parameters Cartesian vectors, with last axis indexing the dimension. Returns ------- v_new: array, shape of v """

    if v.size == 0:
        return v
    mag = vector_mag(v)
    v_new = v.copy()
    v_new[mag == 0.0] = sphere_pick(v.shape[-1], (mag == 0.0).sum(), rng)
    v_new[mag > 0.0] /= mag[mag > 0.0][..., np.newaxis]
    return v_new