Python conversion of Rowan Manning's joblint in JavaScript