def find_source_file(modname, path=None):
    if "." in modname:
        pkgname, modname = modname.rsplit(".", 1)
        pkg = find_package(pkgname)
        return find_source_file(modname, pkg.__path__)
    try:
        fo, fpath, (suffix, mode, mtype) = imp.find_module(modname, path)
    except __HOLE__:
        ex, val, tb = sys.exc_info()
        print("{} => {}: {}!".format(modname, ex.__name__, val), file=sys.stderr)
        return None
    if mtype == imp.PKG_DIRECTORY:
        fo, ipath, desc = imp.find_module("__init__", [fpath])
        fo.close()
        return ipath
    elif mtype == imp.PY_SOURCE:
        return fpath
    else:
        return None
dataset/ETHPy150Open kdart/pycopia/core/pycopia/devhelpers.py/find_source_file