@@ -0,0 +1,812 @@
+from collections.abc import Iterable%0A%0Adef flatten(iter):%0A    %22%22%22%0A    Flatten an arbitrarily nested iterable whose innermost items are strings%0A    into a flat list of strings.%0A    %22%22%22%0A    if isinstance(iter, dict):%0A        iter = iter.values()%0A    def gen():%0A        for item in iter:%0A            if isinstance(item, dict):%0A                item = item.values()%0A            if isinstance(item, Iterable) and not isinstance(item, str):%0A                yield from flatten(item)%0A            else:%0A                yield item%0A    return list(gen())%0A%0A%0Adef test_flatten():%0A    assert sorted(flatten(%7B%0A        'a': %7B%0A            'b': %7B%0A                'c': %5B'a','b','c'%5D,%0A            %7D,%0A        %7D,%0A        'x': %5B'e', 'f', 'g'%5D,%0A        'y': %7B%0A            'z': 'd'%0A        %7D,%0A    %7D)) == %5B'a', 'b', 'c', 'd', 'e', 'f', 'g'%5D%0A

add utils.utils.flatten