Did I find the right examples for you? yes no

All Samples(5)  |  Call(3)  |  Derive(0)  |  Import(2)
Yields a list of the module names the file 'fn' depends on.

        def find_imports(fn, verbose, ignores):
    "Yields a list of the module names the file 'fn' depends on."

    ast, _ = parse_python_source(fn)
    found_imports = get_ast_imports(ast)
    if found_imports is None:
        raise StopIteration

    dn = dirname(fn)

    packroot = None
    for modname, rname, lname, lineno, _, _ in found_imports:
        islocal = False
        names = modname.split('.')
        if find_dotted(names, dn):
            # This is a local import, we need to find the root in order to
            # compute the absolute module name.
            if packroot is None:
                packroot = find_package_root(fn, ignores)
                if not packroot:
                        "%d: Could not find package root for local import '%s' from '%s'." %
                        (lineno, modname, fn))

            reldir = dirname(fn)[len(packroot)+1:]

            modname = '%s.%s' % (reldir.replace(os.sep, '.'), modname)
            islocal = True

        if rname is not None:
            modname = '%s.%s' % (modname, rname)
        yield (modname, lineno, islocal)

src/s/n/snakefood-1.4/lib/python/snakefood/list.py   snakefood(Download)
from snakefood.util import iter_pyfiles, setup_logging, def_ignores
from snakefood.find import find_imports
        for fn in iter_pyfiles(args, opts.ignores):
            all_symnames.update(x[0] for x in
                                find_imports(fn, opts.verbose, opts.ignores))
        for symname in sorted(all_symnames):
            print symname
        for fn in iter_pyfiles(args, opts.ignores):
            if opts.verbose:
                lines = list(open(fn, 'rU'))
            for symname, lineno, islocal in find_imports(fn,

src/m/a/marine-integrations-HEAD/mi/idk/egg_generator.py   marine-integrations(Download)
from snakefood.depends import output_depends, read_depends
from snakefood.find import find_dependencies
from snakefood.find import find_imports
from snakefood.find import ERROR_IMPORT, ERROR_SYMBOL, ERROR_UNUSED
from snakefood.fallback.collections import defaultdict
        log.info("Fetching internal dependecies: %s" % self.filename)
        depends = find_imports(self.filename, 1, 0)
        # Get the list of package roots for our input files and prepend them to the