there is some python code for base function