reformated python snippet a little