The with statement allows all sorts of syntactic sugar in python. This snippet defines two contexts:
preferably which register a function call to be executed at the end of a block of statement. Although they are not very useful (the function call could be written directly at the end of the block, or with the help of a
try...finally structure), some programmers may appreciate this style in certain circumstances.