some Python utilities