I got this answer from stackoverflow about how to quantize a simple input using python:
https://stackoverflow.com/questions/38152081/how-do-you-quantize-a-simple-input-using-python
It is works and it's really helpful. My question is how could I dequantize a simple input using python?