Checks if the module is ready to define itself, and if so,
define it.
352718
function () {
                if (!this.enabled || this.enabling) {
                    return;
                }

                var err, cjsModule,
                    id = this.map.id,
                    depExports = this.depExports,
                    exports = this.exports,
                    factory = this.factory;

                if (!this.inited) {
                    this.fetch();
                } else if (this.error) {
                    this.emit('error', this.error);
                } else if (!this.defining) {
                    //The factory could trigger another require call
                    //that would result in checking this module to
                    //define itself again. If already in the process
                    //of doing that, skip this work.
                    this.defining = true;

                    if (this.depCount < 1 && !this.defined) {
                        if (isFunction(factory)) {
                            //If there is an error listener, favor passing
                            //to that instead of throwing an error. However,
                            //only do it for define()'d  modules. require
                            //errbacks should not be called for failures in
                            //their callbacks (#699). However if a global
                            //onError is set, use that.
                            if ((this.events.error && this.map.isDefine) ||
                                req.onError !== defaultOnError) {
                                try {
                                    exports = context.execCb(id, factory, depExports, exports);
                                } catch (e) {
                                    err = e;
                                }
                            } else {
                                exports = context.execCb(id, factory, depExports, exports);
                            }

                            // Favor return value over exports. If node/cjs in play,
                            // then will not have a return value anyway. Favor
                            // module.exports assignment over exports object.
                            if (this.map.isDefine && exports === undefined) {
                                cjsModule = this.module;
                                if (cjsModule) {
                                    exports = cjsModule.exports;
                                } else if (this.usingExports) {
                                    //exports already set the defined value.
                                    exports = this.exports;
                                }
                            }

                            if (err) {
                                err.requireMap = this.map;
                                err.requireModules = this.map.isDefine ? [this.map.id] : null;
                                err.requireType = this.map.isDefine ? 'define' : 'require';
                                return onError((this.error = err));
                            }

                        } else {
                            //Just a literal value
                            exports = factory;
                        }

                        this.exports = exports;

                        if (this.map.isDefine && !this.ignore) {
                            defined[id] = exports;

                            if (req.onResourceLoad) {
                                req.onResourceLoad(context, this.map, this.depMaps);
                            }
                        }

                        //Clean up
                        cleanRegistry(id);

                        this.defined = true;
                    }

                    //Finished the define stage. Allow calling check again
                    //to allow define notifications below in the case of a
                    //cycle.
                    this.defining = false;

                    if (this.defined && !this.defineEmitted) {
                        this.defineEmitted = true;
                        this.emit('defined', this.exports);
                        this.defineEmitComplete = true;
                    }

                }
            }
476883
function(){
		var self = this;

		// Can only start a module that hasn't been started yet
		self.requireState( munit.ASSERT_STATE_DEFAULT, self.trigger );

		// Setup and trigger module
		self.start = self.end = Date.now();

		// Parent namespaces sometimes don't have tests
		// Also close out paths that aren't part of the focus
		if ( ! self.callback || ! munit.render.focusPath( self.nsPath ) ) {
			self.state = munit.ASSERT_STATE_CLOSED;
			return self._close();
		}

		// Trigger test setup first
		self._setup(function( e, setupCallback ) {
			if ( e ) {
				self.fail( "[munit] Failed to setup '" + self.nsPath + "' module", setupCallback, e );
				return self.close();
			}

			// Run test
			self.callback( self, self.queue );

			// If module isn't finished, then prove that it's supposed to be asynchronous
			if ( self.state < munit.ASSERT_STATE_TEARDOWN ) {
				// Only tear it down if no timeout is specified
				if ( self.options.timeout < 1 ) {
					self.close();
				}
				// Delayed close
				else if ( ! self.isAsync ) {
					self.isAsync = true;
					self._timerStart = Date.now();
					self._timeid = setTimeout(function(){
						if ( self.state < munit.ASSERT_STATE_TEARDOWN ) {
							self.close();
						}
					}, self.options.timeout );
				}
			}
		});

		return self;
	}
1090379
def check_module(mod_name):
    """"""
    # Special cases #
    if mod_name in module_name: mod_name = module_name[mod_name]
    # Use a try except block #
    try:
        __import__(mod_name)
    except ImportError as e:
        if str(e) != 'No module named %s' % mod_name: raise e
        print 'You do not seem to have the "%s" package properly installed.' \
              ' Either you never installed it or your $PYTHONPATH is not set up correctly.' \
              ' For more instructions see the README file. (%s)' % (mod_name, e)
        sys.exit()
1175933
def is_defined? (top_mod, sub_mod = nil)
      return_value = Object.const_defined? top_mod
      unless !return_value || sub_mod.nil?
        return_value = Object.const_get(top_mod).const_defined? sub_mod
      end

      return_value
    end
1180059
def check_initialized(method):
    """"""
    def _decorator(self, *args, **kwargs):
        if self._arguments is None or self._options is None:
            raise RuntimeError('using an uninitialized configuration')
        return method(self, *args, **kwargs)
    return _decorator
813233
public function hasModule($module)
    {
        foreach ($this->data as $index => $row) {
            if ($row[ConstProviderInterface::CONFIG_PARAM_MODULE] == $module) {
                return true;
            }
        }

        return false;
    }
1318667
def has_metadata(python_module):
    """"""
    init_path = '{}/__init__.py'.format(python_module)
    has_metadata = (
        exists(init_path)
        and attributes.has_attribute(python_module, '__version__')
        and attributes.has_attribute(python_module, '__url__')
    )
    return report_and_raise(
        'Has module metadata',
        has_metadata,
        'Your %s/__init__.py must contain __version__ and __url__ attributes',
    )
322887
function areDefined() {
        var objects = Array.prototype.slice.call(arguments);
        for (var i = 0; i < objects.length; i++) {
            if (objects[i] !== null && typeof objects[i] === 'undefined')
                return false;
        }
        return true;
    }
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)
1208066
def validate(self):
        """"""

        changes = self.change_collector.collect_changes()

        features = []
        imported_okay = True
        for importer, modname, modpath in changes.new_feature_info:
            try:
                mod = importer()
                features.extend(_get_contrib_features(mod))
            except (ImportError, SyntaxError):
                logger.info(
                    'Failed to import module at {}'
                    .format(modpath))
                logger.exception('Exception details: ')
                imported_okay = False

        if not imported_okay:
            return False

        # if no features were added at all, reject
        if not features:
            logger.info('Failed to collect any new features.')
            return False

        return all(
            validate_feature_api(feature, self.X, self.y, subsample=False)
            for feature in features
        )
1034235
function hasModule (name) {
    // throw error on invalid name
    requireValidName(name)
    // check if module exists
    return defined(immutable.modules[name]) ? true : false
}
158673
def _prepare_uimodules(self):
        """"""
        for key, value in self._config.get(config.UI_MODULES, {}).iteritems():
            self._config[config.UI_MODULES][key] = self._import_class(value)
        self._config[config.UI_MODULES] = dict(self._config[config.UI_MODULES] or {})
1263319
def check(self):
        """"""
        return programs.is_module_installed(self.modname,
                                            self.required_version,
                                            self.installed_version)
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
434237
def _has_definition(self):
        """"""
        headerReference = self._sectPr.get_headerReference(self._hdrftr_index)
        return False if headerReference is None else True
1278004
private static boolean isSetFromPrecedingModule(
      Ref originalRef, Ref set, JSModuleGraph moduleGraph) {
    return set.type == Ref.Type.SET_FROM_GLOBAL
        && (originalRef.getModule() == set.getModule()
            || moduleGraph.dependsOn(originalRef.getModule(), set.getModule()));
  }
1172428
def has_attribute(module_name, attribute_name):
    """"""
    init_file = '%s/__init__.py' % module_name
    return any(
        [attribute_name in init_line for init_line in open(init_file).readlines()]
    )