Checks the module for documentation and best-practice warnings.
161570
def warn(self, collection):
        """"""
        super(CodeElement, self).warn(collection)
        if not "implicit none" in self.modifiers:
            collection.append("WARNING: implicit none not set in {}".format(self.name))
67743
public function validateModuleID()
    {
        if (!empty($this->moduleID)) {
            $module = Yii::$app->getModule($this->moduleID);
            if ($module === null) {
                $this->addError('moduleID', "Module '{$this->moduleID}' does not exist.");
            }
        }
    }
165732
def check(modname):
    """"""
    for dependency in DEPENDENCIES:
        if dependency.modname == modname:
            return dependency.check()
    else:
        raise RuntimeError("Unkwown dependency %s" % modname)
134642
def validate(self, lsid, check_existing=True):
        
        # Base LSID matches
        if not lsid.startswith(self.base_lsid):
            return False

        # Module number isn't already taken
        if check_existing and lsid in self.registered_modules:
            return False

        # Everything checks out, return True
        return True
783643
function check(suppliedOptions){
    var options = assign(Object.create(defaultOptions), suppliedOptions || {});
    var packageJson = require(path.resolve(process.cwd(), options.package));
    var checkDevDependencies = !!options.checkDevDependencies;
    var checkDependencies = !!options.checkDependencies;
    var moduleTimes = {
        dependencies: {},
        devDependencies: {}
    };
    var loadTime = -1;

    if(packageJson.main){
        loadTime = execSync(execString + path.resolve(process.cwd(), packageJson.main), {encoding: "utf8"});
    }

    if(checkDependencies){
        Object.keys(packageJson.dependencies).forEach(function(depen){
            var time = execSync(execString + path.resolve(process.cwd(), "node_modules", depen), {
                encoding: "utf8",
                cwd: process.cwd()
            });

            moduleTimes.dependencies[depen] = parseFloat(time);
        });
    }

    if(checkDevDependencies){
        Object.keys(packageJson.devDependencies).forEach(function(depen){
            var time = execSync(execString + path.resolve(process.cwd(), "node_modules", depen), {
                encoding: "utf8",
                cwd: process.cwd()
            });

            moduleTimes.devDependencies[depen] = parseFloat(time);
        });
    }

    return {
        moduleTimes: moduleTimes,
        loadTime: loadTime
    };
}
494441
def is_module(obj):
    
    return True if obj and isinstance(obj, ModuleType) or inspect.isclass(obj) else False
66563
def _is_module_included(self, module):
        
        if module in self.exclude_modules:
            return False

        if self.include_modules is None:
            return True

        return module in self.include_modules
24043
def module_is_imported(modname, scope=None):
    """"""
    # return early if modname is not even cached
    if not module_is_in_cache(modname):
        return False

    if scope is None:  # use globals() of the caller by default
        scope = inspect.stack()[1][0].f_globals

    for m in scope.values():
        if isinstance(m, type(sys)) and m.__name__ == modname:
            return True

    return False
248602
def check(self, strict=False):
        """"""
        self.set_metadata_version()

        # XXX should check the versions (if the file was loaded)
        missing, warnings = [], []

        for attr in ('Name', 'Version'):  # required by PEP 345
            if attr not in self:
                missing.append(attr)

        if strict and missing != []:
            msg = 'missing required metadata: %s' % ', '.join(missing)
            raise MetadataMissingError(msg)

        for attr in ('Home-page', 'Author'):
            if attr not in self:
                missing.append(attr)

        # checking metadata 1.2 (XXX needs to check 1.1, 1.0)
        if self['Metadata-Version'] != '1.2':
            return missing, warnings

        scheme = get_scheme(self.scheme)

        def are_valid_constraints(value):
            for v in value:
                if not scheme.is_valid_matcher(v.split(';')[0]):
                    return False
            return True

        for fields, controller in ((_PREDICATE_FIELDS, are_valid_constraints),
                                   (_VERSIONS_FIELDS,
                                    scheme.is_valid_constraint_list),
                                   (_VERSION_FIELDS,
                                    scheme.is_valid_version)):
            for field in fields:
                value = self.get(field, None)
                if value is not None and not controller(value):
                    warnings.append('Wrong value for %r: %s' % (field, value))

        return missing, warnings
799438
function(mods) {
			for (var i = 0, len = mods.length; i < len; i++) {
				if (!internal.is_module_ready(mods[i])) {
					return false;
				}
			}

			return true;
		}
618778
void checkNoMods(long mods) {
        if (mods != 0) {
            long lowestMod = mods & -mods;
            error(token.pos, "mod.not.allowed.here",
                    Flags.asFlagSet(lowestMod));
        }
    }
208350
function check(node) {
    				var scope = context.getScope();
    				checkScope(scope);
    				// If using ES6 modules check the child 'module' scope
    				if (node.type === "Program" && node.sourceType === "module"){
    					checkScope(scope.childScopes[0]);
    				}
        		}
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)
349023
def _check_parse_modtime(self, filepath, fname):
        """"""       
        #We also want to perform a reparse if the XML documentation file for the
        #module changed, since the docs are also cached.
        file_mtime = self._get_mod_mtime(filepath)
        
        #If we have parsed this file and have its modules in memory, its
        #filepath will be in self._parsed. Otherwise we can load it from
        #file or from a cached pickle version.
        if filepath.lower() in self._parsed: 
            #Get the name of the first module in that file from the modulefiles
            #list. Find out when it was last modified.
            module_mtime = None
            if fname in self._modulefiles:
                if len(self._modulefiles[fname]) == 0:
                    msg.warn("Module file {} has no modules defined inside of it!".format(fname))
                    return None
                
                modulename = self._modulefiles[fname][0]
                if modulename in self.modules:
                    #Make sure that if there are modules with the same name but different
                    #files, that we are working with the correct one.
                    if filepath.lower() != self.modules[modulename].filepath:
                        msg.warn("module {} parsed ".format(modulename) + 
                                 "from {}, not {}".format(self.modules[modulename].filepath,
                                                          filepath))
                    module_mtime = self.modules[modulename].change_time

            if module_mtime is not None:
                if module_mtime < file_mtime:
                    #The file has been modified since we reloaded the module.
                    #Return the two times we used for the comparison so the
                    #module file can be reloaded.
                    return [module_mtime, file_mtime]
                else:
                    return None
        else:
            #The file has never been parsed by this CodeParser. We can
            #either do a full parse or a pickle load.
            return [file_mtime]
971695
def should_display_warnings_for(to_type):
    
    if not hasattr(to_type, '__module__'):
        return True
    elif to_type.__module__ in {'builtins'} or to_type.__module__.startswith('parsyfiles') \
            or to_type.__name__ in {'DataFrame'}:
        return False
    elif issubclass(to_type, int) or issubclass(to_type, str) \
            or issubclass(to_type, float) or issubclass(to_type, bool):
        return False
    else:
        return True
700625
def check_docstrings(show_diff=False, config=None, mods=None):
    

    readme = parse_readme()
    modules_readme = core_module_docstrings(config=config)
    warned = False
    if create_readme(readme) != create_readme(modules_readme):
        for module in sorted(readme):
            if mods and module not in mods:
                continue
            err = None
            if module not in modules_readme:
                err = "Module {} in README but not in /modules".format(module)
            elif (
                "".join(readme[module]).strip()
                != "".join(modules_readme[module]).strip()
            ):
                err = "Module {} docstring does not match README".format(module)
            if err:
                if not warned:
                    print_stderr("Documentation does not match!\n")
                    warned = True
                print_stderr(err)

        for module in modules_readme:
            if mods and module not in mods:
                continue
            if module not in readme:
                print_stderr("Module {} in /modules but not in README".format(module))
        if show_diff:
            print_stderr(
                "\n".join(
                    difflib.unified_diff(
                        create_readme(readme).split("\n"),
                        create_readme(modules_readme).split("\n"),
                    )
                )
            )
        else:
            if warned:
                print_stderr("\nUse `py3-cmd docstring --diff` to view diff.")
182991
def ensure_compliance(self):
        """"""
        if not self.modules:
            return

        try:
            loaded_modules = self._get_loaded_modules()
            non_compliant_modules = []
            for module in self.modules:
                if module in loaded_modules:
                    log("Module '%s' is enabled but should not be." %
                        (module), level=INFO)
                    non_compliant_modules.append(module)

            if len(non_compliant_modules) == 0:
                return

            for module in non_compliant_modules:
                self._disable_module(module)
            self._restart_apache()
        except subprocess.CalledProcessError as e:
            log('Error occurred auditing apache module compliance. '
                'This may have been already reported. '
                'Output is: %s' % e.output, level=ERROR)