def METHOD_NAME(gbls, version_check=False):
    def loadmod_full(name, gbls):
        mod = _mimport(name)
        for key in mod.__dict__:
            if not key.startswith('_'):
                gbls[key] = mod.__dict__[key]
    for name in ('os', 'sys', 'numpy', 'ctypes', 'libs', '__version__'):
        gbls[name] = globals()[name]
    loadmod_full('version', gbls)
    loadmod_full('mdsdata', gbls)
    loadmod_full('mdsscalar', gbls)
    loadmod_full('mdsarray', gbls)
    loadmod_full('compound', gbls)
    loadmod_full('descriptor', gbls)
    loadmod_full('apd', gbls)
    loadmod_full('event', gbls)
    loadmod_full('tree', gbls)
    loadmod_full('scope', gbls)
    loadmod_full('_mdsshr', gbls)
    loadmod_full('mdsExceptions', gbls)
    loadmod_full('mdsdcl', gbls)
    if libs.MdsIpShr is not None:
        loadmod_full('connection', gbls)
    gbls["PyLib"] = os.getenv("PyLib")
    return gbls