Some python utilities