`map` in Python 3 returns a generator, which can only be iterated over once and is then exhausted. Since we use `new_keys` twice here, we need to convert it to a list.