Add tools/common.py from 2.13