[python] How to calculate a logistic sigmoid function in Python?