'Create a LazyModule instance wrapping module name.
The module will later on be registered in locals under the
given module name.
globals is optional and defaults to locals.'

def __init__(self, name, locals, globals=None):

    self.__lazymodule_locals = locals
    if (globals is None):
        globals = locals
    self.__lazymodule_globals = globals
    mainname = globals.get('__name__', '')
    if mainname:
        self.__name__ = ((mainname + '.') + name)
        self.__lazymodule_name = name
    else:
        self.__name__ = self.__lazymodule_name = name
    self.__lazymodule_init = 1
