Did I find the right examples for you? yes no

All Samples(21)  |  Call(18)  |  Derive(0)  |  Import(3)
Find module `module_name` on sys.path

Return the path to module `module_name`. If `module_name` refers to
a module directory then return path to __init__ file. Return full 
path of module or None if module is missing or does not have .py or .pyw
extension. We are not interested in running bytecode.

Parameters
----------
module_name : str(more...)

        def find_mod(module_name):
    """Find module `module_name` on sys.path
    
    Return the path to module `module_name`. If `module_name` refers to
    a module directory then return path to __init__ file. Return full 
    path of module or None if module is missing or does not have .py or .pyw
    extension. We are not interested in running bytecode.
    
    Parameters
    ----------
    module_name : str
    
    Returns
    -------
    modulepath : str
        Path to module `module_name`.
    """
    parts = module_name.split(".")
    basepath = find_module(parts[0])
    for submodname in parts[1:]:
        basepath = find_module(submodname, [basepath])
    if basepath and os.path.isdir(basepath):
        basepath = get_init(basepath)
    return basepath
        


src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/IPython/core/magics/execution.py   antisocial(Download)
from IPython.utils.io import capture_output
from IPython.utils.ipstruct import Struct
from IPython.utils.module_paths import find_mod
from IPython.utils.path import get_py_filename, unquote_filename
from IPython.utils.timing import clock, clock2
        if "m" in opts:
            modulename = opts["m"][0]
            modpath = find_mod(modulename)
            if modpath is None:
                warn('%r is not a valid modulename on sys.path'%modulename)

src/i/p/ipython-2.0.0/IPython/core/magics/execution.py   ipython(Download)
from IPython.utils.io import capture_output
from IPython.utils.ipstruct import Struct
from IPython.utils.module_paths import find_mod
from IPython.utils.path import get_py_filename, unquote_filename, shellglob
from IPython.utils.timing import clock, clock2
        if "m" in opts:
            modulename = opts["m"][0]
            modpath = find_mod(modulename)
            if modpath is None:
                warn('%r is not a valid modulename on sys.path'%modulename)

src/i/p/ipython-HEAD/IPython/core/magics/execution.py   ipython(Download)
from IPython.utils.io import capture_output
from IPython.utils.ipstruct import Struct
from IPython.utils.module_paths import find_mod
from IPython.utils.path import get_py_filename, unquote_filename, shellglob
from IPython.utils.timing import clock, clock2
        if "m" in opts:
            modulename = opts["m"][0]
            modpath = find_mod(modulename)
            if modpath is None:
                warn('%r is not a valid modulename on sys.path'%modulename)

src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/IPython/utils/tests/test_module_paths.py   antisocial(Download)
def test_find_mod_1():
    modpath = join(TMP_TEST_DIR, "xmod", "__init__.py")
    assert mp.find_mod("xmod") == modpath
 
def test_find_mod_2():
    modpath = join(TMP_TEST_DIR, "xmod", "__init__.py")
    assert mp.find_mod("xmod") == modpath
def test_find_mod_3():
    modpath = join(TMP_TEST_DIR, "xmod", "sub.py")
    assert mp.find_mod("xmod.sub") == modpath
 
def test_find_mod_4():
    modpath = join(TMP_TEST_DIR, "pack.py")
    assert mp.find_mod("pack") == modpath
 
def test_find_mod_5():
    assert mp.find_mod("packpyc") is None

src/i/p/ipython-2.0.0/IPython/utils/tests/test_module_paths.py   ipython(Download)
def test_find_mod_1():
    modpath = join(TMP_TEST_DIR, "xmod", "__init__.py")
    assert mp.find_mod("xmod") == modpath
 
def test_find_mod_2():
    modpath = join(TMP_TEST_DIR, "xmod", "__init__.py")
    assert mp.find_mod("xmod") == modpath
def test_find_mod_3():
    modpath = join(TMP_TEST_DIR, "xmod", "sub.py")
    assert mp.find_mod("xmod.sub") == modpath
 
def test_find_mod_4():
    modpath = join(TMP_TEST_DIR, "pack.py")
    assert mp.find_mod("pack") == modpath
 
def test_find_mod_5():
    assert mp.find_mod("packpyc") is None

src/i/p/ipython-HEAD/IPython/utils/tests/test_module_paths.py   ipython(Download)
def test_find_mod_1():
    modpath = join(TMP_TEST_DIR, "xmod", "__init__.py")
    assert mp.find_mod("xmod") == modpath
 
def test_find_mod_2():
    modpath = join(TMP_TEST_DIR, "xmod", "__init__.py")
    assert mp.find_mod("xmod") == modpath
def test_find_mod_3():
    modpath = join(TMP_TEST_DIR, "xmod", "sub.py")
    assert mp.find_mod("xmod.sub") == modpath
 
def test_find_mod_4():
    modpath = join(TMP_TEST_DIR, "pack.py")
    assert mp.find_mod("pack") == modpath
 
def test_find_mod_5():
    assert mp.find_mod("packpyc") is None