Preprocess Text Function Python Format String