Return the full path name of MOD.

    MOD is the basename of a dll or pyd.
    XTRAPATH is a path or list of paths to search first.
    Return the full path name of MOD.
    Will search the full Windows search path, as well as sys.path
19312
def getfullnameof(mod, xtrapath=None):
    
    # Search sys.path first!
    epath = sys.path + winutils.get_system_path()
    if xtrapath is not None:
        if type(xtrapath) == type(''):
            epath.insert(0, xtrapath)
        else:
            epath = xtrapath + epath
    for p in epath:
        npth = os.path.join(p, mod)
        if os.path.exists(npth):
            return npth
        # second try: lower case filename
        for p in epath:
            npth = os.path.join(p, mod.lower())
            if os.path.exists(npth):
                return npth
    return ''
65215
def is_module_in_pathlist(self, module):
        """"""
        modpath = getattr(module, '__file__', None)

        # Skip module according to different criteria
        if modpath is None:
            # *module* is a C module that is statically linked into the
            # interpreter. There is no way to know its path, so we
            # choose to ignore it.
            return True
        elif any([p in modpath for p in self.pathlist]):
            # We don't want to reload modules that belong to the
            # standard library or installed to site-packages,
            # just modules created by the user.
            return True
        elif not os.name == 'nt':
            # Module paths containing the strings below can be ihherited
            # from the default Linux installation, Homebrew or the user
            # site-packages in a virtualenv.
            patterns = [r'^/usr/lib.*',
                        r'^/usr/local/lib.*',
                        r'^/usr/.*/dist-packages/.*',
                        r'^/home/.*/.local/lib.*',
                        r'^/Library/.*',
                        r'^/Users/.*/Library/.*',
                        r'^/Users/.*/.local/.*',
            ]

            if [p for p in patterns if re.search(p, modpath)]:
                return True
            else:
                return False
        else:
            return False
658287
def modpath_last(module, entry_point):
    

    module_paths = modpath_all(module, entry_point)
    if len(module_paths) > 1:
        logger.info(
            "module '%s' has multiple paths, default selecting '%s' as base.",
            module.__name__, module_paths[-1],
        )
    return module_paths[-1:]
1163589
def full_path(self):
        """"""

        if self.parent:
            return os.path.join(self.parent.full_path, self.name)
        return self.name
1277983
def find_module(self, fullname):
        

        spec = self.find_spec(fullname)
        if spec is None:
            return None

        # We need to handle the namespace case here for python2
        if spec.loader is None and len(spec.submodule_search_locations):
            spec.loader = NamespaceLoader2(spec.name, spec.submodule_search_locations)

        return spec.loader
595971
def _extension(modpath: str) -> setuptools.Extension:
    """"""
    return setuptools.Extension(modpath, [modpath.replace(".", "/") + ".py"])
1213659
function getModulePath (mod, useAbsolutePath) {
  const modPath =
    mod === 'regenerator-runtime'
      ? 'regenerator-runtime/runtime'
      : `core-js/modules/${mod}`
  return useAbsolutePath ? require.resolve(modPath) : modPath
}
556339
def find_module(self, modname, folder=None):
        
        for src in self.get_source_folders():
            module = _find_module_in_folder(src, modname)
            if module is not None:
                return module
        for src in self.get_python_path_folders():
            module = _find_module_in_folder(src, modname)
            if module is not None:
                return module
        if folder is not None:
            module = _find_module_in_folder(folder, modname)
            if module is not None:
                return module
        return None
447556
def _get_module_path(name, fail=False, install_path=None):
    
    import imp

    module = imp.find_module(name)
    if not module and fail:
        raise RuntimeError("can't find module '" + name + "'")
    path = module[1]
    if not path and fail:
        raise RuntimeError("module '" + name + "' is missing a file path")
    
    if install_path:
        return os.path.join(install_path, os.path.split(path)[1])

    return path
820783
def get_module_path(exc_type):
    
    module = inspect.getmodule(exc_type)
    return "{}.{}".format(module.__name__, exc_type.__name__)
847153
def fullpath(self, **kwargs):
        
        kwargs_copy = self.base_dict.copy()
        kwargs_copy.update(**kwargs)
        self._replace_none(kwargs_copy)        
        return NameFactory.fullpath_format.format(**kwargs_copy)
557452
def full_path(self):
        
        if "local" in self.driver.name.lower():
            return "%s/%s" % self.container.key, self.path
        return self.path
199003
function (moduleNamePlusExt) {
              var ext,
                index = moduleNamePlusExt.lastIndexOf("."),
                segment = moduleNamePlusExt.split("/")[0],
                isRelative = segment === "." || segment === "..";

              //Have a file extension alias, and it is not the
              //dots from a relative path.
              if (index !== -1 && (!isRelative || index > 1)) {
                ext = moduleNamePlusExt.substring(
                  index,
                  moduleNamePlusExt.length
                );
                moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
              }

              return context.nameToUrl(
                normalize(moduleNamePlusExt, relMap && relMap.id, true),
                ext,
                true
              );
            }
438705
def load_module(self, fullname):
        
        mod = sys.modules.get(fullname)
        if mod is not None:
            return mod

        # We're creating an object rather than a module. It's a hack, but it's approved by Guido:
        # https://mail.python.org/pipermail/python-ideas/2012-May/014969.html

        mod = _from_core_node(self._store, self._root)
        sys.modules[fullname] = mod
        return mod
1072130
def findModuleOfName(self, dotted_name, level, filename, extrapath=None):
        """"""
        if dotted_name.endswith('.*'):
            return dotted_name[:-2]
        name = dotted_name

        # extrapath is None only in a couple of test cases; in real life it's
        # always present
        if level and level > 1 and extrapath:
            # strip trailing path bits for each extra level to account for
            # relative imports
            # from . import X has level == 1 and nothing is stripped (the level > 1 check accounts for this case)
            # from .. import X has level == 2 and one trailing path component must go
            # from ... import X has level == 3 and two trailing path components must go
            extrapath = extrapath.split(os.path.sep)
            level -= 1
            extrapath = extrapath[0:-level]
            extrapath = os.path.sep.join(extrapath)

        while name:
            candidate = self.isModule(name, extrapath)
            if candidate:
                return candidate
            candidate = self.isPackage(name, extrapath)
            if candidate:
                return candidate
            name = name[:name.rfind('.')]
        self.warn(dotted_name, '%s: could not find %s', filename, dotted_name)
        return dotted_name
1117398
def check_modpath_has_init(path, mod_path):
    """"""
    modpath = []
    for part in mod_path:
        modpath.append(part)
        path = os.path.join(path, part)
        if not _has_init(path):
            old_namespace = util.is_namespace(".".join(modpath))
            if not old_namespace:
                return False
    return True
1215871
def load_module(self, fullname):
        
        root, base, target = fullname.partition(self.root_name + '.')
        for prefix in self.search_path:
            try:
                extant = prefix + target
                __import__(extant)
                mod = sys.modules[extant]
                sys.modules[fullname] = mod
                # mysterious hack:
                # Remove the reference to the extant package/module
                # on later Python versions to cause relative imports
                # in the vendor package to resolve the same modules
                # as those going through this importer.
                if prefix and sys.version_info > (3, 3):
                    del sys.modules[extant]
                return mod
            except ImportError:
                pass
        else:
            raise ImportError(
                "The '{target}' package is required; "
                "normally this is bundled with this package so if you get "
                "this warning, consult the packager of your "
                "distribution.".format(**locals())
            )