Find the path prefix to the node_modules containing needed utilities.
558242
function prefix(pattern) {
        if (!pattern) {
            pattern = 'grunt-available-tasks';
        }
        pattern = pattern.replace(/^node_modules\//, '');
        var ret;
        if (grunt.file.expand('node_modules/' + pattern).length) {
            ret = 'node_modules/';
        } else if (grunt.file.expand('../../node_modules/' + pattern).length) {
            ret = '../../node_modules/';
        } else if (grunt.file.expand('node_modules/chronicles_of_grunt/node_modules/' + pattern).length) {
            ret = 'node_modules/chronicles_of_grunt/node_modules/';
        } else {
            grunt.fail.fatal("Cannot find module path for " + pattern);
        }
        return ret;
    }
815914
def get_prefixes(self, ns_uri):
        """"""
        ni = self.__lookup_uri(ns_uri)
        return ni.prefixes.copy()
489504
function getModulePath(module, path) {
        var modulePath = module.uri.substr(0, module.uri.lastIndexOf("/") + 1);
        if (path) {
            modulePath += path;
        }

        return modulePath;
    }
911294
function getModulePath(sModuleName, sSuffix){
		return sap.ui.require.toUrl(sModuleName.replace(/\./g, "/") + sSuffix);
	}
679150
def module_names(self):
        
        controller_prefix = self.controller_prefix
        _module_name_cache = self._module_name_cache
        if controller_prefix in _module_name_cache:
            return _module_name_cache[controller_prefix]

        module = self.get_module(controller_prefix)

        if hasattr(module, "__path__"):
            # path attr exists so this is a package
            modules = self.find_modules(module.__path__[0], controller_prefix)

        else:
            # we have a lonely .py file
            modules = set([controller_prefix])

        _module_name_cache.setdefault(controller_prefix, {})
        _module_name_cache[controller_prefix] = modules

        return modules
687590
def get_module_path(modname):
    """"""
    return osp.abspath(osp.dirname(sys.modules[modname].__file__))
820783
def get_module_path(exc_type):
    
    module = inspect.getmodule(exc_type)
    return "{}.{}".format(module.__name__, exc_type.__name__)
1187783
function(dir, prefix) {
    if (fs.existsSync(dir)) {
      let dirname = path.relative(this.project.root, dir);
      let globs = this.parentRegistry.extensionsForType('js').map((extension) => `**/*.${extension}`);

      return walkSync(dir, { directories: false, globs }).map(file => {
        let module = prefix + '/' + file.replace(EXT_RE, '.js');
        this.fileLookup[module] = path.join(dirname, file);
        return module;
      });
    } else {
      return [];
    }
  }
1353385
function (root_path, default_prefix) {
		var arr = SR.Settings.SR_PATH.split(SR.path.sep);
		var prefix = arr[arr.length-1] + '-';
		var dirs = UTIL.getDirectoriesSync(root_path);

		if (default_prefix)
			prefix = default_prefix;
		
		//LOG.warn('default_prefix: ' + default_prefix + ' prefix: ' + prefix + ' paths to check:');
		for (var i in dirs) {
			//LOG.warn(dirs[i]);
			if (dirs[i].startsWith(prefix)) { 
				SR.Settings.MOD_PATHS.push(SR.path.resolve(root_path, dirs[i]));
			}
		}
	}
305928
def _find_package(parts):
    """"""
    for i in range(len(parts), 0, -1):
        prefix = '.'.join(parts[0:i])
        if prefix in sys.modules:
            return i, sys.modules[prefix]
    return 0, None
514042
function scanTreeForNodesModules(moduleName) {
    var dir = settings.coreNodesDir;
    var results = [];
    var userDir;

    if (settings.userDir) {
        userDir = path.join(settings.userDir,"node_modules");
        results = scanDirForNodesModules(userDir,moduleName);
        results.forEach(function(r) { r.local = true; });
    }

    if (dir) {
        var up = path.resolve(path.join(dir,".."));
        while (up !== dir) {
            var pm = path.join(dir,"node_modules");
            if (pm != userDir) {
                results = results.concat(scanDirForNodesModules(pm,moduleName));
            }
            dir = up;
            up = path.resolve(path.join(dir,".."));
        }
    }
    return results;
}
900109
def _get_paths(self):
        """"""
        ret = []
        ret += ['%s/library/' % os.path.dirname(os.path.dirname(__file__))]        
        
        ret += self._extra_dirs
        for basedir in _basedirs:
            fullpath = os.path.join(basedir, self.subdir)
            if fullpath not in ret:
                ret.append(fullpath)
        ret += self.config.split(os.pathsep)
        ret += self._get_package_path()
        return ret
666749
def mk_path_list(stmt):
    
    resolved_names = []
    def resolve_stmt(stmt, resolved_names):
        if stmt.keyword in ['choice', 'case']:
            resolve_stmt(stmt.parent, resolved_names)
            return
        def qualified_name_elements(stmt):
            """(module name, prefix, name)"""
            return (stmt.i_module.arg, stmt.i_module.i_prefix, stmt.arg)
        if stmt.parent.keyword in ['module', 'submodule']:
            resolved_names.append(qualified_name_elements(stmt))
            return
        else:
            resolve_stmt(stmt.parent, resolved_names)
            resolved_names.append(qualified_name_elements(stmt))
            return
    resolve_stmt(stmt, resolved_names)
    return resolved_names
430712
def _get_modules_map(self, path=None):
        '''
        
        '''
        paths = {}
        root = ansible.modules.__path__[0]
        if not path:
            path = root
        for p_el in os.listdir(path):
            p_el_path = os.path.join(path, p_el)
            if os.path.islink(p_el_path):
                continue
            if os.path.isdir(p_el_path):
                paths.update(self._get_modules_map(p_el_path))
            else:
                if (any(p_el.startswith(elm) for elm in ['__', '.']) or
                        not p_el.endswith('.py') or
                        p_el in ansible.constants.IGNORE_FILES):
                    continue
                p_el_path = p_el_path.replace(root, '').split('.')[0]
                als_name = p_el_path.replace('.', '').replace('/', '', 1).replace('/', '.')
                paths[als_name] = p_el_path

        return paths
323798
def modpath_all(module, entry_point):
    

    module_paths = getattr(module, '__path__', [])
    if not module_paths:
        logger.warning(
            "module '%s' does not appear to be a namespace module or does not "
            "export available paths onto the filesystem; JavaScript source "
            "files cannot be extracted from this module.", module.__name__
        )
    return module_paths
897255
function resolveModulePath(moduleName) {
  let modulePath = path.dirname(require.resolve(moduleName));
  return locateLoaderFolder(modulePath)
}
802956
def get_distribution_paths(name):
    """"""
    pyver = 'python' + sys.version[:3]

    paths = {
        'prefix' : '{prefix}',
        'data'   : '{prefix}/lib/{pyver}/site-packages',
        'purelib': '{prefix}/lib/{pyver}/site-packages',
        'platlib': '{prefix}/lib/{pyver}/site-packages',
        'headers': '{prefix}/include/{pyver}/{name}',
        'scripts': '{prefix}/bin',
    }

    # pip uses a similar path as an alternative to the system's (read-only)
    # include directory:
    if hasattr(sys, 'real_prefix'):  # virtualenv
        paths['headers'] = os.path.abspath(
            os.path.join(sys.prefix, 'include', 'site', pyver, name))

    # Replacing vars
    for key, val in paths.items():
        paths[key] = val.format(prefix=PREFIX, name=name, pyver=pyver)
    return paths