def _import(name):
    """Return module from a package.

    These two are equivalent:

        > from package import module as bar
        > bar = _import('package.module')

    """
    mod = __import__(name)
    components = name.split('.')
    for comp in components[1:]:
        try:
            mod = getattr(mod, comp)
        except AttributeError:
            raise ImportError(mod % "No module named %s")
    return mod


# tools for binary Gray code manipulation:
dataset/ETHPy150Open pybrain/pybrain/pybrain/utilities.py/_import/swapped operands of `%`