Did I find the right examples for you? yes no

All Samples(15)  |  Call(15)  |  Derive(0)  |  Import(0)
imp.find_module variant that only return path of module.

The `imp.find_module` returns a filehandle that we are not interested in.
Also we ignore any bytecode files that `imp.find_module` finds.

Parameters
----------
name : str
    name of module to locate
path : list of str(more...)

        def find_module(name, path=None):
    """imp.find_module variant that only return path of module.
    
    The `imp.find_module` returns a filehandle that we are not interested in.
    Also we ignore any bytecode files that `imp.find_module` finds.

    Parameters
    ----------
    name : str
        name of module to locate
    path : list of str
        list of paths to search for `name`. If path=None then search sys.path

    Returns
    -------
    filename : str
        Return full path of module or None if module is missing or does not have
        .py or .pyw extension
    """
    if name is None:
        return None
    try:
        file, filename, _ = imp.find_module(name, path)
    except ImportError:
        return None
    if file is None:
        return filename
    else:
        file.close()
    if os.path.splitext(filename)[1] in [".py", "pyc"]:
        return filename
    else:
        return None
        


src/a/n/antisocial-HEAD/ve/lib/python2.7/site-packages/IPython/utils/tests/test_module_paths.py   antisocial(Download)
def test_find_module_1():
    modpath = join(TMP_TEST_DIR, "xmod")
    assert mp.find_module("xmod") == modpath
 
def test_find_module_2():
    """Testing sys.path that is empty"""
    assert mp.find_module("xmod", []) is None
def test_find_module_3():
    """Testing sys.path that is empty"""
    assert mp.find_module(None, None) is None
 
def test_find_module_4():
    """Testing sys.path that is empty"""
    assert mp.find_module(None) is None
 
def test_find_module_5():
    assert mp.find_module("xmod.nopack") is None

src/i/p/ipython-2.0.0/IPython/utils/tests/test_module_paths.py   ipython(Download)
def test_find_module_1():
    modpath = join(TMP_TEST_DIR, "xmod")
    assert mp.find_module("xmod") == modpath
 
def test_find_module_2():
    """Testing sys.path that is empty"""
    assert mp.find_module("xmod", []) is None
def test_find_module_3():
    """Testing sys.path that is empty"""
    assert mp.find_module(None, None) is None
 
def test_find_module_4():
    """Testing sys.path that is empty"""
    assert mp.find_module(None) is None
 
def test_find_module_5():
    assert mp.find_module("xmod.nopack") is None

src/i/p/ipython-HEAD/IPython/utils/tests/test_module_paths.py   ipython(Download)
def test_find_module_1():
    modpath = join(TMP_TEST_DIR, "xmod")
    assert mp.find_module("xmod") == modpath
 
def test_find_module_2():
    """Testing sys.path that is empty"""
    assert mp.find_module("xmod", []) is None
def test_find_module_3():
    """Testing sys.path that is empty"""
    assert mp.find_module(None, None) is None
 
def test_find_module_4():
    """Testing sys.path that is empty"""
    assert mp.find_module(None) is None
 
def test_find_module_5():
    assert mp.find_module("xmod.nopack") is None