reformat code of swarch.py