shebang invocation, a couple concise idioms

I imagine we can assume Python 2.7 (for the literal-style dictionary
comprehension)?
use collections