[tools] clean pylab demo code