Did I find the right examples for you? yes no

All Samples(12)  |  Call(8)  |  Derive(0)  |  Import(4)
Import and return ``bar`` given the string ``foo.bar``.

Calling ``bar = import_item("foo.bar")`` is the functional equivalent of
executing the code ``from foo import bar``.

Parameters
----------
name : string
  The fully qualified name of the module/package being imported.
(more...)

        def import_item(name):
    """Import and return ``bar`` given the string ``foo.bar``.

    Calling ``bar = import_item("foo.bar")`` is the functional equivalent of
    executing the code ``from foo import bar``.

    Parameters
    ----------
    name : string
      The fully qualified name of the module/package being imported.

    Returns
    -------
    mod : module object
       The module that was imported.
    """
    
    parts = name.rsplit('.', 1)
    if len(parts) == 2:
        # called with 'foo.bar....'
        package, obj = parts
        module = __import__(package, fromlist=[obj])
        try:
            pak = module.__dict__[obj]
        except KeyError:
            raise ImportError('No module named %s' % obj)
        return pak
    else:
        # called with un-dotted string
        return __import__(parts[0])
        


src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/IPython/utils/traitlets.py   antisocial(Download)
    ClassTypes = (type,)
 
from .importstring import import_item
from IPython.utils import py3compat
 
    def _resolve_classes(self):
        if isinstance(self.klass, basestring):
            self.klass = import_item(self.klass)
        if isinstance(self.default_value, basestring):
            self.default_value = import_item(self.default_value)
    def _resolve_classes(self):
        if isinstance(self.klass, basestring):
            self.klass = import_item(self.klass)
 
    def get_default_value(self):

src/o/p/openmm-0.2/ipcfg/IPython/traitlets.py   openmm(Download)
    ClassTypes = (type,)
 
from importstring import import_item
import py3compat
 
    def _resolve_classes(self):
        if isinstance(self.klass, basestring):
            self.klass = import_item(self.klass)
        if isinstance(self.default_value, basestring):
            self.default_value = import_item(self.default_value)
    def _resolve_classes(self):
        if isinstance(self.klass, basestring):
            self.klass = import_item(self.klass)
 
    def get_default_value(self):

src/i/p/ipython-2.0.0/IPython/utils/pickleutil.py   ipython(Download)
from . import codeutil  # This registers a hook when it's imported
from . import py3compat
from .importstring import import_item
from .py3compat import string_types, iteritems
 
        if isinstance(key, string_types):
            try:
                cls = import_item(key)
            except Exception:
                if original and key not in original:

src/i/p/ipython-HEAD/IPython/utils/pickleutil.py   ipython(Download)
from . import codeutil  # This registers a hook when it's imported
from . import py3compat
from .importstring import import_item
from .py3compat import string_types, iteritems
 
        if isinstance(key, string_types):
            try:
                cls = import_item(key)
            except Exception:
                if original and key not in original: