Determine if an
@param modulePath
@param options
@returns {boolean}
544548
function exists(modulePath, options) {

        if (this.aliases[modulePath]) {
            modulePath = this.aliases[modulePath];
        }

        var len = this.factories.length - 1; // -1 because we don't want the default factory
        for (var i = 0; this.factories && i < len; i++) {
            if (this.factories[i].isCandidate(modulePath, options)) {
                return true;
            }
        }

        return false;
    }
59453
def check_extensions(module_name, module_path):
    
    option_name = '%s_extend' % module_name
    version = config.get('Boto', option_name, None)
    if version:
        dirname = module_path[0]
        path = os.path.join(dirname, version)
        if os.path.isdir(path):
            log.info('extending module %s with: %s' % (module_name, path))
            module_path.insert(0, path)
555816
public boolean isSiteRoot(String rootPath) {

        String siteRoot = getSiteRoot(rootPath);
        rootPath = CmsStringUtil.joinPaths(rootPath, "/");
        return rootPath.equals(siteRoot);

    }
821304
function (moduleCtrlPrivate) {
                if (moduleCtrlPrivate == null) {
                    return false;
                }
                var k = moduleCtrlPrivate[MODULECTRL_ID_PROPERTY];
                var res = modulesPrivateInfo[k];
                if (!res) {
                    return false;
                }
                if (res.moduleCtrlPrivate != moduleCtrlPrivate) {
                    return false;
                }
                var subModuleInfos = res.subModuleInfos;
                return (subModuleInfos != null);
            }
1185085
function isCandidate(modulePath) {

        // the 'FromPlugin' suffix is used when a project wants to override a plugin module
        if (modulePath === /.*FromPlugin/) {
            modulePath = modulePath.substring(0, modulePath.length - 10);
        }
        modulePath = modulePath.toLowerCase();

        return !!this.serverModules[modulePath];
    }
352028
function create(modulePath, moduleStack, options) {

        // the 'FromPlugin' suffix is used when a project wants to override a plugin module
        if (modulePath === /.*FromPlugin/) {
            modulePath = modulePath.substring(0, modulePath.length - 10);
        }
        modulePath = modulePath.toLowerCase();

        // first check the cache to see if we already loaded it
        if (this.cache[modulePath]) {
            return this.cache[modulePath];
        }

        // if module not in server modules, return null
        var flapjack = this.serverModules[modulePath];
        if (!flapjack) {
            return null;
        }

        // switch to server if exists
        flapjack = flapjack.server ? flapjack.server : flapjack;

        // if flapjack is not a function, just return it (i.e. its just a normal require()
        if (!_.isFunction(flapjack)) {
            this.cache[modulePath] = flapjack;
            return flapjack;
        }

        this.cache[modulePath] = this.injector.injectFlapjack(flapjack, moduleStack, options);
        return this.cache[modulePath];
    }
1315921
function find_from_node_modules(id, options){
  var basedir = options.filename ? path.dirname(options.filename) : options.basedir;
  var folders = find_node_module_folder(basedir);

  var entry;

  for(var i = 0; i< folders.length; i++){
    entry = find_node_module_entry(folders[i], id, options);

    if(entry) return entry;
  }
}
1369144
function isExpoProject(projPath) {
	try {
		let module = resolveFrom(projPath, "expo");
		let appInfo = require(`${projPath}/app.json`);

		return !!(module && appInfo.expo);
	} catch (err) {
		return false;
	}
}
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
302367
def isModule(self, dotted_name, extrapath=None):
        """"""
        try:
            return self._module_cache[(dotted_name, extrapath)]
        except KeyError:
            pass
        if dotted_name in sys.modules or dotted_name in self.builtin_modules:
            return dotted_name
        filename = dotted_name.replace('.', os.path.sep)
        if extrapath:
            for ext in self._exts:
                candidate = os.path.join(extrapath, filename) + ext
                if os.path.exists(candidate):
                    modname = self.filenameToModname(candidate)
                    self._module_cache[(dotted_name, extrapath)] = modname
                    return modname
        try:
            return self._module_cache[(dotted_name, None)]
        except KeyError:
            pass
        for dir in self.path:
            if os.path.isfile(dir):
                if dir.endswith('.egg-info'):
                    # distribute creates a setuptools-blah-blah.egg-info
                    # that ends up in sys.path
                    continue
                try:
                    zf = zipfile.ZipFile(dir)
                except zipfile.BadZipfile:
                    self.warn(dir, "%s: not a directory or zip file", dir)
                    continue
                names = zf.namelist()
                for ext in self._exts:
                    candidate = filename + ext
                    if candidate in names:
                        modname = filename.replace(os.path.sep, '.')
                        self._module_cache[(dotted_name, extrapath)] = modname
                        self._module_cache[(dotted_name, None)] = modname
                        return modname
            else:
                for ext in self._exts:
                    candidate = os.path.join(dir, filename) + ext
                    if os.path.exists(candidate):
                        modname = self.filenameToModname(candidate)
                        self._module_cache[(dotted_name, extrapath)] = modname
                        self._module_cache[(dotted_name, None)] = modname
                        return modname
        return None
559989
function( name, options, callback ) {
		var ns = munit.ns,
			parts = name.split( rpathsplit ),
			finalPart = parts.pop(),
			opts = munit.extend( true, {}, munit.defaults.settings ),
			assert = null,
			path = '';

		// Filter through all parents
		parts.forEach(function( mod ) {
			// Update the path
			if ( path.length ) {
				path += '.';
			}
			path += mod;

			// Assign assert module
			if ( ! ns[ mod ] ) {
				assert = ns[ mod ] = new munit.Assert( path, assert, opts );
			}

			// Trickle down the path
			assert = ns[ mod ];
			ns = assert.ns;
			opts = munit.extend( true, {}, opts, assert.options );
		});

		// Module already exists, update it
		if ( ns[ finalPart ] ) {
			assert = ns[ finalPart ];

			// Test module is already in use, code setup is wrong
			if ( assert.callback ) {
				throw new munit.AssertionError( "'" + name + "' module has already been created", munit._createModule );
			}
			
			assert.options = munit.extend( true, {}, opts, options );
			assert.callback = callback;
		}
		else {
			options = munit.extend( true, {}, opts, options );
			assert = ns[ finalPart ] = new munit.Assert( name, assert, options, callback );
		}

		// Return the assertion module for use
		return assert;
	}
1222158
function componentExists(componentPath) {
  const existsInExtensions = fs.existsSync(path.resolve(EXTENSIONS_PATH, componentPath));
  const existsInWidgets = fs.existsSync(path.resolve(themes.getPath(), 'widgets', componentPath));

  return !(!existsInExtensions && !existsInWidgets);
}
67767
public static function exists(string $moduleName, array $options = []) : bool
    {
        $config = (new ModuleConfig(ConfigType::MIGRATION(), $moduleName, null, $options))->parseToArray();
        if (empty($config)) {
            return false;
        }

        $config = (new ModuleConfig(ConfigType::MODULE(), $moduleName, null, $options))->parseToArray();
        if (empty($config['table']) || empty($config['table']['type'])) {
            return false;
        }

        return true;
    }
660538
function isJavaScriptFile(filepath) {
  if (!fs.statSync(filepath).isFile()) {
    return false;
  }
  if (path.basename(filepath) === 'index.js') {
    return false;
  }
  return filepath.slice(-3) === '.js';
}
1488
public static ModuleItem findModuleItem(String[] path) {
        if (disabled)
            return null;
        if (path == null || path[0].equals(APPSERVER_MODULE)) {
            return moduleRoot;
        }
        return moduleRoot.find(path, 0);
    }
1294712
function verifyTsConfig(configFilePath) {
	/**
	 * @type {string[]}
	 */
	const warnings = [];
	const createConfigFileHost = {
		onUnRecoverableConfigFileDiagnostic() {},
		useCaseSensitiveFileNames: false,
		readDirectory: typescript.sys.readDirectory,
		fileExists: typescript.sys.fileExists,
		readFile: typescript.sys.readFile,
		getCurrentDirectory: typescript.sys.getCurrentDirectory,
	};
	const tsconfig = typescript.getParsedCommandLineOfConfigFile(configFilePath, {}, createConfigFileHost);
	if (!tsconfig) {
		return [`could not parse "${configFilePath}"`];
	}
	if (tsconfig.options.skipLibCheck === undefined) {
		warnings.push(
			'skipLibCheck option was NOT specified\n' +
				'By default the fork-ts-checker-webpack-plugin will check all types inside the node_modules directory\n' +
				'even for unused dependencies and slow down the type checking a lot.\n' +
				'To skip that checking add the following line to your tsconfig.json compilerOptions configuration:\n' +
				'"skipLibCheck": true\n' +
				'To keep the default behaviour with possible performance penalties set skipLibCheck to false to hide this warning.\n'
		);
	}
	if (tsconfig.options.moduleResolution === undefined) {
		warnings.push(
			'moduleResolution option was NOT specified\n' +
				'This will result in typescript warnings like "module not found".\n' +
				'To fix that add the following line to your tsconfig.json compilerOptions configuration:\n' +
				'"moduleResolution": "node"\n' +
				'To keep the default behaviour with possible type checking errors set moduleResolution to "classic" to hide this warning.\n'
		);
	}

	return warnings;
}
843205
function moduleExists(name) {
  //TODO: Check that the file exists before trying to require it.
  try {
    require.resolve(name);
  }
  catch (err) {
    this.server.emit('error', err);
    return false;
  }
  return true;
}