Checks module validity.

@param string $module Module name
@return bool
343307
private function isModule(string $module) : bool
    {
        $config = (new ModuleConfig(ConfigType::MIGRATION(), $module, null, ['cacheSkip' => true]))->parse();
        $config = json_encode($config);
        if (false === $config) {
            return false;
        }
        $config = json_decode($config, true);
        if (empty($config)) {
            return false;
        }

        $config = (new ModuleConfig(ConfigType::MODULE(), $module, null, ['cacheSkip' => true]))->parse();
        if (! property_exists($config, 'table')) {
            return false;
        }
        if (! property_exists($config->table, 'type')) {
            return false;
        }

        if ('module' !== $config->table->type) {
            return false;
        }

        return true;
    }
1011406
public function removeModule($module)
    {
        foreach ($this->modules as $key => $moduleElement) {
            if ($moduleElement === $module) {
                unset($this->modules[$key]);
                break;
            }
        }

        return $this;
    }
1009798
public function isOperational($moduleName) {
    	if(!array_key_exists($moduleName, $this->modules_list)) {
    		if($module = fw\Module::getModuleByName($moduleName)) {
    			if($module instanceof DependentInterface) {
    				if($module->validatePrerequisites()) {
    					$this->modules_list[$moduleName] = TRUE;
    					return true;
    				} else {
    					// Do not cache the result,
    					// as they could change by the next call to the method
    					return false;
    				}
    			}
    			else {
    				$this->modules_list[$moduleName] = TRUE;
    				return true;
    			}
    		}
    		else {
    			$this->modules_list[$moduleName] = FALSE;
    		}
    	}
    	return $this->modules_list[$moduleName];
    	
    }
1347799
protected function isConfiguredModulePresenceDisabled(ModuleInterface $module)
    {
        if ( ! array_key_exists($module->getKey(), $this->configModules)) {
            return false;
        }

        return false === $this->configModules[ $module->getKey() ];
    }
836821
public function add(Module $module)
    {
        $this->modules[$module->getName()] = $module;

        if ($module instanceof RootModule) {
            $this->rootModule = $module;
        }
    }
1076822
def is_module_loaded(module):
    """"""
    matches = re.findall('^%s[ ]+' % module, lsmod(), re.M)
    return len(matches) > 0
1182638
public function isDefined($module, $action)
    {
        foreach ($this->widgets as $widget) {
            if ($widget->getModule() === $module && $widget->getAction() === $action) {
                return true;
            }
        }

        return false;
    }
517157
public function checkDependenciesExtensions(array $module)
    {
        if (!empty($module['extensions'])) {

            $missing = array();

            foreach ($module['extensions'] as $extension) {
                if (!extension_loaded($extension)) {
                    $missing[] = $extension;
                }
            }

            if (!empty($missing)) {
                $error = $this->translation->text("Missing PHP extensions: @list", array('@list' => implode(',', $missing)));
                throw new UnexpectedValueException($error);
            }
        }

        return true;
    }
1209724
public static void validate(final Module module) {
        if (null == module) {
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST)
                .entity("Module cannot be null!")
                .build());
        }
        if(module.getName() == null ||
                module.getName().isEmpty()){
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST)
                    .entity("Module name cannot be null or empty!")
                    .build());
        }
        if(module.getVersion()== null ||
                module.getVersion().isEmpty()){
            throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST)
                    .entity("Module version cannot be null or empty!")
                    .build());
        }

        // Check artifacts
        for(final Artifact artifact: DataUtils.getAllArtifacts(module)){
            validate(artifact);
        }

        // Check dependencies
        for(final Dependency dependency: DataUtils.getAllDependencies(module)){
            validate(dependency.getTarget());
        }
    }
470658
public function containsModules(array $modules)
    {
        foreach ($modules as $module) {
            if (!$this->modules->contains($module)) {
                return false;
            }
        }

        return true;
    }
427866
public static function isValid($mode)
    {
        switch (strtolower($mode)) {
        case self::AUTO:
        case self::MANUAL:
        return true;

        default:
        return false;
        }
    }
289926
public function isCoreModule($module)
    {
        if (!is_string($module)) {
            throw new InvalidArgumentException(sprintf(
                'Module name must be a string, not "%s"', gettype($module)
            ));
        }

        return in_array($module, $this->coreModules);
    }
540344
public function getInstance($module)
    {
        if ( ! $this->isLoaded($module))
        {
            $this->load($module);
        }

        return $this->instances[$module];
    }
327485
public function removeAllByModule($module)
    {
        $this->initializeOnDemand();

        if ($this->arrayConfig->hasModule($module) && $this->configMapper->deleteAllByModule($module)) {
            $this->arrayConfig->removeAllByModule($module);
            return true;
        } else {
            return false;
        }
    }
196949
protected function validateMetadataExtendSection(\OxidEsales\Eshop\Core\Module\Module $module)
    {
        $validator = $this->getModuleMetadataValidator();
        $validator->checkModuleExtensionsForIncorrectNamespaceClasses($module);
    }
701738
public function addModule($module) {
        $this->registerModule($module);
        if (is_object($module)) $module = $module->name;
        $this->userModules[] = $module;
    }
1129997
public static function isDebugModeEnabled(Module $module)
    {
        return Craft::$app->getConfig()->getGeneral()->devMode ||
            ($module instanceof LoggableInterface && $module->isDebugModeEnabled());
    }