'Load an IPython extension by its module name.
Returns the string "already loaded" if the extension is already loaded,
"no load function" if the module doesn\'t have a load_ipython_extension
function, or None if it succeeded.'

def load_extension(self, module_str):

    if (module_str in self.loaded):
        return 'already    loaded'
    from IPython.utils.syspathcontext import prepended_to_syspath
    with self.shell.builtin_trap:
        if (module_str not in sys.modules):
            with prepended_to_syspath(self.ipython_extension_dir):
                mod = import_module(module_str)
                if mod.__file__.startswith(self.ipython_extension_dir):
                    print 'Loading    extensions    from    {dir}    is    deprecated.    We    recommend    managing    extensions    like    any    other    Python    packages,    in    site-packages.'.format(dir=compress_user(self.ipython_extension_dir))
        mod = sys.modules[module_str]
        if self._call_load_ipython_extension(mod):
            self.loaded.add(module_str)
        else:
            return 'no    load    function'
