Did I find the right examples for you? yes no

All Samples(7)  |  Call(5)  |  Derive(0)  |  Import(2)
Import a module.

The 'package' argument is required when performing a relative import. It
specifies the package to use as the anchor point from which to resolve the
relative import to an absolute import.

        def import_module(name, package=None):
    """Import a module.

    The 'package' argument is required when performing a relative import. It
    specifies the package to use as the anchor point from which to resolve the
    relative import to an absolute import.

    """
    if name.startswith('.'):
        if not package:
            raise TypeError("relative imports require the 'package' argument")
        level = 0
        for character in name:
            if character != '.':
                break
            level += 1
        name = _resolve_name(name[level:], package, level)
    __import__(name)
    return sys.modules[name]
        


src/d/i/digsby-HEAD/digsby/src/plugins/nowplaying/nowplaying.py   digsby(Download)
from common import profile, pref
 
from util import import_module, RepeatTimer, memoize, Storage as S, odict, iproperty
from util.lrucache import LRU
from util.threads import threaded
        modname ='nowplaying.%s' % player_name
        if modname not in sys.modules:
            sys.modules[modname] = import_module(modname)
    try:
        return song_checkers[player_name]

src/m/e/mem-HEAD/mem/_mem.py   mem(Download)
                set_attr("subdir", os.path.join(self.orig_dir, subdir))
                set_attr("memfile", os.path.join(self.subdir, memfile))
                set_attr("mf", util.import_module(self.memfile, self.memfile))
 
            def __getattr__(self, memfunc):

src/m/e/mem-HEAD/mem/__init__.py   mem(Download)
def import_memfile(f):
    return util.import_module(f, f)
 
def main():
    sys.path.append("./")

src/s/m/Smap-2.0.bcb1a7/smap/driver.py   Smap(Download)
        elif scheme == 'python':
            # load data by calling a python function
            u = util.import_module(urlparse.urlparse(self.uri).netloc)
            self.update = lambda: self.process(u(opts))
        else:

src/m/y/mydb-0.1.2/mydb/router.py   mydb(Download)
#!/usr/bin/python
# -*- coding: utf-8 -*-
from .util import import_module
from .pinning import this_thread_is_pinned
 
                try:
                    module_name, klass_name = r.rsplit('.', 1)
                    module = import_module(module_name)
                except ImportError, e:
                    raise ImproperlyConfigured('Error importing database router %s: "%s"' % (klass_name, e))