def get_root_modules():
    ip = get_ipython()

    if 'rootmodules' in ip.db:
        return ip.db['rootmodules']
    
    t = time()
    store = False
    modules = list(sys.builtin_module_names)
    for path in sys.path:
        modules += module_list(path)        
        if time() - t >= TIMEOUT_STORAGE and not store:
            store = True
            print("\nCaching the list of root modules, please wait!")
            print("(This will only be done once - type '%rehashx' to "
                  "reset cache!)\n")
            sys.stdout.flush()
        if time() - t > TIMEOUT_GIVEUP:
            print("This is taking too long, we give up.\n")
            ip.db['rootmodules'] = []
            return []
    
    modules = set(modules)
    if '__init__' in modules:
        modules.remove('__init__')
    modules = list(modules)
    if store:
        ip.db['rootmodules'] = modules
    return modules
Store server config
dataset/ETHPy150Open ipython/ipython-py3k/IPython/core/completerlib.py/get_root_modules--crossover with--dataset/ETHPy150Open gawel/irc3/irc3/plugins/core.py/Core.set_config