def assertDeepEqualIters(a, b):
    """
    Assert that nested iterables have equal elements in order, regardless of iterable type
    like assertEqualIters, but arbitrarily deep and regardless of structure.
    For example,
    ["ab", "cd", "ef", "gh", 1, [[[2]]]]
    is not equal to
    ["ab", ["c", "d"], ("e", "f"), (c for c in "gh"), 1, [[[2]]]]
    not even according to assertEqualIters, but according to this function they are.
    """
    try:
        iter(a)
    except __HOLE__:
        assert a == b
    else:

        # Avoid infinite recursion for single character strings
        if isinstance(a, basestring) and len(a) == 1:
            assert a == b
            return

        for i1, i2 in izip_longest(a, b, fillvalue=object()):
            assertDeepEqualIters(i1, i2)
dataset/ETHPy150Open alexmojaki/funcfinder/funcfinder/utils.py/assertDeepEqualIters