def walk_packages(path=None, prefix='', onerror=None):

    def seen(p, m={}):
        if p in m:
            return True
        m[p] = True

    for importer, name, ispkg in iter_modules(path, prefix):
        yield importer, name, ispkg

        if ispkg:
            try:
                __import__(name)
            except ImportError:
                if onerror is not None:
                    onerror(name)
            except Exception:
                if onerror is not None:
                    onerror(name)
                else:
                    raise
            else:
                path = getattr(sys.modules[name], '__path__', None) or []

                # don't traverse path items we've seen before
                path = [p for p in path if not seen(p)]

                for item in walk_packages(path, name+'.', onerror):
                    yield item
Specifies a time limit for a query operation. If the specified
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/pkgutil.py/walk_packages--crossover with--dataset/ETHPy150Open blynch/CloudMemeBackend/pymongo/cursor.py/Cursor.max_time_ms