Use the std lib's is_not from operator
Use chain.from_iterable

Name constants for itemgetter