Run the modules

@param Module module
@return Beverage
177314
public function then(Module $module)
    {
        $this->current_state = $module->process($this->current_state);

        return $this;
    }
1243947
public function run()
    {
        $vendorDir = dirname(dirname(__FILE__));
        $baseDir = dirname($vendorDir);
        spl_autoload_register(function ($className) use($baseDir) {
            if (file_exists($file = $baseDir . '/database/seeds/' . $className . '.php')) {
                include($file);
                return true;
            }
        });

        $this->call([
            ModulesTableSeeder::class,
            PrivilegesTableSeeder::class,
            SettingsTableSeeder::class,
        ]);
    }
1166708
def run(*args, **kwargs):
    '''
    
    '''
    lib = sys.modules[asynclib.lib_name]
    lib.run(*args, **kwargs)
782119
def run_module(kwargs):
    
    runner_name = kwargs.pop('runner_name')
    klass = getattr(ansible_mitogen.runner, runner_name)
    impl = klass(**mitogen.core.Kwargs(kwargs))
    return impl.run()
313260
def run(self, module, dependency=False, kwargs={}):
        '''
        
        '''
        try:
            obj = self.load(module, kwargs)

            if isinstance(obj, binwalk.core.module.Module) and obj.enabled:
                obj.main()
                self.status.clear()

            # If the module is not being loaded as a dependency, add it to the executed modules dictionary.
            # This is used later in self.execute to determine which objects
            # should be returned.
            if not dependency:
                self.executed_modules[module] = obj

                # The unload method tells the module that we're done with it, and gives it a chance to do
                # any cleanup operations that may be necessary. We still retain
                # the object instance in self.executed_modules.
                obj._unload_dependencies()
                obj.unload()
        except KeyboardInterrupt as e:
            # Tell the status server to shut down, and give it time to clean
            # up.
            if self.status.running:
                self.status.shutdown = True
                while not self.status.finished:
                    time.sleep(0.1)
            raise e

        return obj
851241
function runModules(str, modules) {
    var replacements = [],
        module;

    if (Array.isArray(modules) === false) {
        modules = [modules];
    }

    modules.forEach(function forEachModule(module) {
        if (!module) {
            throw new Error("Unknown module '" + module + "'");
        }

        runModule(module, str, replacements);
    });

    return replacements;
}
1267854
public static function register(Module $module) {
        $name = $module->getNamespace();
        if ($name == 'wulaphp') {
            $msg = __('the namespace of %s cannot be wulaphp', $module->clzName);
            log_warn($msg, 'bootstrap');

            return;
        }
        if (!preg_match('/^[a-z][a-z_\d]+(\\\\[a-z][a-z_\d]+)*$/i', $name)) {
            $msg = __('The namespace "%s" of %s is invalid', $name, $module->clzName);
            log_warn($msg, 'bootstrap');

            return;
        }
        $dir = $module->getDirname();
        if ($dir != $name) {
            self::$maps ['dir2id'] [ $dir ]  = $name;
            self::$maps ['id2dir'] [ $name ] = $dir;
        }
        self::$modules [ $name ] = $module;
        $module->enabled         = self::$app->moduleLoader->isEnabled($module);
    }
585585
function runModule(module, str, replacements) {
    var pattern = module.pattern,
        replace = module.replace,
        match;

    // Reset the pattern so we can re-use it
    pattern.lastIndex = 0;

    while ((match = pattern.exec(str)) !== null) {
        replacements[match.index] = {
            oldStr: match[0],
            newStr: typeof replace === "function"? replace(match) : replace
        };
        if (pattern.global === false) {
            // if the search isn't global we need to break manually
            // because pattern.exec() will always return something
            break;
        }
    }
}
55146
public function registerModules($modules = [])
    {
        for($i = 0; $i < sizeof($modules); $i++) {
            $moduleName = $modules[$i];

            $module = $this->createNew($moduleName);

            if (!$module instanceof ModuleInterface) {
                throw new InvalidModuleException('The module at position '.($i+1).' is invalid');
            }

            $serviceProvider = $module->getServiceProvider();
            $this->getContainer()->registerServices($serviceProvider);
        }
    }
1357718
public function run(string $module, array $options = []) : int
    {
        $mc = new ModuleConfig(ConfigType::MENUS(), $module, null, ['cacheSkip' => true]);

        $schema = $mc->createSchema(['lint' => true]);
        $mc->setParser(new Parser($schema, ['lint' => true, 'validate' => true]));

        try {
            $mc->parse();
        } catch (InvalidArgumentException $e) {
            // We need errors and warnings irrelevant of the exception
            $this->errors = array_merge($this->errors, $mc->getErrors());
        }
        $this->warnings = array_merge($this->warnings, $mc->getWarnings());

        return count($this->errors);
    }
665138
public function run($method = 'getResult', $hydrationMode = Query::HYDRATE_OBJECT)
    {
        return $this->getInstance()->getQuery()->$method($hydrationMode);
    }
679584
public function activateModule(
        $module,
        $defaultModules = ['MelisAssetManager', 'MelisComposerDeploy', 'MelisDbDeploy', 'MelisCore'],
        $excludeModule = ['MelisModuleConfig'])
    {
        // Default melis modules
        $activeModules = $this->getActiveModules($defaultModules);

        // Removing "MelisModuleConfig" if exist on activated modules
        foreach ($activeModules as $key => $mod) {
            if (in_array($mod, $excludeModule)) {
                unset($activeModules[$key]);
            }
        }

        array_push($activeModules, $module);

        // Creating/updating module.load.php including new module
        return $this->createModuleLoader('config/', $activeModules, $defaultModules);
    }
57131
public function addModule($module)
    {
        if (!($module instanceof ModuleInterface)) {
            $module = new Module($module);
        }

        return ($this->modules[$module->getName()] = $module);
    }
1309945
function createModule(module) {
        var moduleInstance,
            moduleId;

        if (typeof module === 'function') {
            try {
                moduleInstance = module();
            } catch (ex) {
                if (module.getId) {
                    moduleId = module.getId();
                } else {
                    moduleId = module.name;
                }

                error('Failed to create an instance of module "' + moduleId + '".',
                      'Application will continue running without the module. ' +
                      'See following exception stack for more details.',
                      ex.stack);
            }
        } else {
            moduleInstance = module;
        }

        addOne(moduleInstances, moduleInstance);

        return moduleInstance;
    }
246109
public DbModule getDbModule(final Module module) {
        final DbModule dbModule = new DbModule();

        dbModule.setName(module.getName());
        dbModule.setVersion(module.getVersion());
        dbModule.setPromoted(module.isPromoted());
        dbModule.setSubmodule(module.isSubmodule());
        dbModule.setCreatedDateTime(module.getCreatedDateTime());
        dbModule.setUpdatedDateTime(module.getUpdatedDateTime());

        // Artifact
        for (final Artifact artifact : module.getArtifacts()) {
            final DbArtifact dbArtifact = getDbArtifact(artifact);
            dbModule.addArtifact(dbArtifact);
        }

        // Dependencies
        for (final Dependency dependency : module.getDependencies()) {
            dbModule.addDependency(dependency.getTarget().getGavc(), dependency.getScope());
        }

        // SubModules
        final StringBuilder sb = new StringBuilder();
        for (final Module submodule : module.getSubmodules()) {
            final DbModule dbSubmodule = getDbModule(submodule);
            dbModule.addSubmodule(dbSubmodule);
            sb.setLength(0);
        }

        return dbModule;
    }
983663
public function migrateModule(ModuleContainerInterface $module)
    {
        $path = $module->getPath(['database', 'migrations']);
        $files = $this->migrator->getMigrationFiles($path);

        // Once we grab all of the migration files for the path, we will compare them
        // against the migrations that have already been run for this package then
        // run each of the outstanding migrations against a database connection.
        $ran = $this->migrator->getRepository()->getRan();

        $migrations = array_diff($files, $ran);
        $this->migrator->requireFiles($path, $migrations);

        foreach ($migrations as $migration) {
            $this->migrations[] = $migration;
        }

        return $this;
    }
601833
def run_modules(self):
    """"""

    def _run_module_thread(module_description):
      """Runs the module's process() function.

      Waits for any blockers to have finished before running process(), then
      sets an Event flag declaring the module has completed.
      """
      for blocker in module_description['wants']:
        self.events[blocker].wait()
      module = self._module_pool[module_description['name']]
      try:
        module.process()
      except DFTimewolfError as error:
        self.add_error(error.message, critical=True)
      except Exception as error:  # pylint: disable=broad-except
        self.add_error(
            'An unknown error occurred: {0!s}\nFull traceback:\n{1:s}'.format(
                error, traceback.format_exc()),
            critical=True)
      print('Module {0:s} completed'.format(module_description['name']))
      self.events[module_description['name']].set()
      self.cleanup()

    threads = []
    for module_description in self.recipe['modules']:
      t = threading.Thread(
          target=_run_module_thread,
          args=(module_description, )
      )
      threads.append(t)
      t.start()
    for t in threads:
      t.join()

    self.check_errors(is_global=True)