Show me an implementation of nucleus sampling written in python