def multi_iter(iterable, count=2):
    """Return `count` independent, thread-safe iterators for `iterable`"""
    # no need to special-case re-usable, container-like iterables
    if not isinstance(
            iterable,
            (
                    list, tuple, set,
                    FutureChainResults,
                    collections.Sequence, collections.Set, collections.Mapping, collections.MappingView
            )):
        iterable = SafeTee(iterable, n=count)
    return (iter(iterable) for _ in range(count))
def multi_iter ( iterable , count = 2 ) : if not isinstance ( iterable , ( list , tuple , set , FutureChainResults , collections . Sequence , collections . Set , collections . Mapping , collections . MappingView ) ) : iterable = SafeTee ( iterable , n = count ) return ( iter ( iterable ) for _ in range ( count ) )
Return `count` independent, thread-safe iterators for `iterable`