Added option to run locally in python wrapper