Ran python-modernize through the codebase.
Fixed import of itertools.imap