Some useful python utilities