Implement `top_p_sampling`. Libraries (NumPy, PyTorch, SciPy) are allowed, but Pure Python implementations earn bonus XP!
top_p_sampling(*args, **kwargs)