Properly duplicate iterable in test/gen_key_sequences.partition()