Check if active dynamicly attached module
173805
protected static function isActive($dbId)
    {
        if (!isset(static::$_modulesData[$dbId])) {
            $result = static::findOne($dbId);
            static::$_modulesData[$dbId] = $result;
        }
        if (empty(static::$_modulesData[$dbId])) {
            return false;
        } else {
            $isActive = static::$_modulesData[$dbId]->is_active;
            return $isActive;
        }
    }
1128834
def _is_builtin_module(module):
    
    if (not hasattr(module, '__file__')) or  module.__name__ in sys.builtin_module_names:
        return True
    if module.__name__ in _stdlib._STD_LIB_MODULES:
        return True
    amp = os.path.abspath(module.__file__)
    if 'site-packages' in amp:
        return False
    if amp.startswith(_STD_MODULE_DIR):
        return True
    if not '.' in module.__name__:
        return False
    mn_top = module.__name__.split('.')[0]
    return mn_top in _stdlib._STD_LIB_MODULES
151468
def is_templatetags_module_valid_constant(node):
    """"""
    if node.name not in ('register', ):
        return False

    parent = node.parent
    while not isinstance(parent, Module):
        parent = parent.parent

    if "templatetags." not in parent.name:
        return False

    return True
486215
def is_submodule(self, name):
        
        return self.name != name and name.startswith(self.name)
1231790
function isLoaded(modulesNames) {
                    var moduleLoaded = function moduleLoaded(module) {
                        var isLoaded = regModules.indexOf(module) > -1;
                        if (!isLoaded) {
                            isLoaded = !!moduleExists(module);
                        }
                        return isLoaded;
                    };
                    if (angular.isString(modulesNames)) {
                        modulesNames = [modulesNames];
                    }
                    if (angular.isArray(modulesNames)) {
                        var i, len;
                        for (i = 0, len = modulesNames.length; i < len; i++) {
                            if (!moduleLoaded(modulesNames[i])) {
                                return false;
                            }
                        }
                        return true;
                    } else {
                        throw new Error('You need to define the module(s) name(s)');
                    }
                }
1371993
def _check_module(folder):
        
        if not folder.exists():
            folder.mkdir(parents=True, exist_ok=True, mode=0o755)
            (folder / '__init__.py').touch()
214410
function() {
			if (Loader.loading) { return false; }

			var count	= 0;

			if (some(this.pending, function(script) {
				count++;
				if (script.satisfied()) {
					Loader.loading = script;
					script.module.install();
					script.load();
					return true;
				}
				return false;
			}) || count === 0) { return true; }
			return false;
		}
1199276
function watchModule (module, modulesDir) {

    const pathToModule = resolve(modulesDir, module);
    const pathToHandlers = resolve(HANDLER_BASE, module);


    modules[module] = {
        handlers: []
    };
    fs.readdir(pathToHandlers, (err, files) => {

        if (err) {
            return console.log(new Error('Failed to get handler files for module: ' + module));
        }

        files.forEach(file => {

            if (file.length < 3 || file.indexOf('bundle.') === 0 || file.substr(file.length - 3) !== '.js') {
                return;
            }

            modules[module].handlers.push(pathToHandlers + '/' + file);
        });

        let watchList = modules[module].handlers.concat([pathToModule]);
        let watcher = chokidar.watch(watchList, {
            ignored: /(^|[\/\\])\../,
            persistent: true
        });
        watcher.on('change', (path, stats) => {

            // rebundle based on the type of the file
            if (modules[module].handlers.indexOf(path) < 0) {
                modules[module].handlers.forEach(handler => bundleHandler(pathToHandlers, module, handler.substr(handler.lastIndexOf('/') + 1)));
            } else {
                bundleHandler(pathToHandlers, module, path.substr(path.lastIndexOf('/') + 1));
            }
        });
    });
}
1294039
def is_module(self, name):
        """"""
        if self.module_prefix.startswith(self.mount_prefix):
            return name.startswith(self.module_prefix)
        return name.startswith(self.module_prefix) and not name.startswith(self.mount_prefix)
180253
function check() {
    module.hot.check(function(err, updatedModules) {
      if (err) return handleError(err);

      if (!updatedModules) {
        logger.warn('Cannot find update any update.');
        return;
      }

      apply(updatedModules);
    });
  }
1373447
def is_active(ext, metadata):
    """"""
    if metadata.get('run_control', {}).get('frozen') is True:
        return False
    if 'active' not in metadata:
        return True
    return ext.replace('.', '') in re.split('\\.|,', metadata['active'])
1206663
function isNested(obj) {
    if (getType(obj)==='object') {
        for (let tag in obj) {
            if (tag != TEXT && !ATTRTAG.test(tag)) {
                return true;
            }
        }
    }
}
58139
function(moduleId) {
		var visitedModules = {};
		var recurse = function(moduleId) {
			if (visitedModules[moduleId] == true) { return true; }
			visitedModules[moduleId] = true;
			var module = getModule(moduleId);
			if (!module || !module.defined) { return false; }
			else {
				var deps = module.deps || [];
				for (var i = deps.length; i--;) {
					if (!recurse(deps[i])) {
						return false;
					}
				}
				return true;
			}
		};
		return recurse(moduleId);
	}
64541
public function isModuleSearch()
    {
        global $pagenow;

        if ($pagenow == 'edit.php' && isset($_GET['s']) && $_GET['s'] !== '') {
            $enabled = \Modularity\ModuleManager::$enabled;
            if (in_array($_GET['post_type'], $enabled)) {
                return true;
            }
        }

        return false;
    }
446795
function (templateCtxt) {
            var moduleCtrl = templateCtxt.moduleCtrlPrivate;
            // find associated module
            var modules = this._data.modules, i, l;
            for (i = 0, l = modules.length; i < l; i++) {
                if (modules[i].moduleCtrl == moduleCtrl) {
                    this._data.selectedModule = modules[i];
                    break;
                } else {
                    this._data.selectedModule = null;
                }
            }
            // find associated template description
            this._data.selectedTemplate = this._findTemplateDes(this._data.templates, templateCtxt);

        }
140762
function checkModule(pth, cb) {
  checkStrider(pth, function(err, config){
    if (err) return cb(err);
    if (config){
      config.dir = pth;
      return cb(null, config);
    }
    checkPackageJson(pth, function(err, config){
      if (err) return cb(err);
      if (config){
        config.dir = pth;
        return cb(null, config);
      }
      return cb(null, false);
    });
  });
}
1270019
def autoloaded?(desc)
      # No name => anonymous module.
      return false if desc.is_a?(Module) && desc.name.blank?
      name = to_constant_name desc
      return false unless qualified_const_defined? name
      return autoloaded_constants.include?(name)
    end