Generate the module
173680
protected function compile()
  {
    if (!\Input::get('ssoLogin'))
    {
      return;
    }

    $ssoHash = \Input::get('ssoLogin');

    $objSession = \Session::getInstance();

    if ($objSession)

      $objUser = \MemberModel::findBy('ssoHash', $ssoHash);

    if ($objUser !== null)
    {
      $time = time();

      $blnAccountError = false;

      // Check whether account is locked
      if (($objUser->locked + $GLOBALS['TL_CONFIG']['lockPeriod']) > $time)
      {
          $blnAccountError = true;
          $_SESSION['TL_ERROR'][] = sprintf($GLOBALS['TL_LANG']['ERR']['accountLocked'], ceil((($objUser->locked + $GLOBALS['TL_CONFIG']['lockPeriod']) - $time) / 60));
          $this->redirectTo403();
      }

      // Check whether account is disabled
      elseif ($objUser->disable)
      {
          $blnAccountError = true;

          $_SESSION['TL_ERROR'][] = $GLOBALS['TL_LANG']['ERR']['invalidLogin'];
          $this->log('The account has been disabled', __METHOD__, TL_ACCESS);
          $this->redirectTo403();
      }

      // Check wether login is allowed (front end only)
      elseif (!$objUser->login)
      {
          $blnAccountError = true;

          $_SESSION['TL_ERROR'][] = $GLOBALS['TL_LANG']['ERR']['invalidLogin'];
          $this->log('User "' . $objUser->username . '" is not allowed to log in', __METHOD__, TL_ACCESS);
          $this->redirectTo403();
      }

      // Check whether account is not active yet or anymore
      elseif (strlen($objUser->start) || strlen($objUser->stop))
      {
        if (strlen($objUser->start) && $objUser->start > $time)
        {
          $blnAccountError = true;

          $_SESSION['TL_ERROR'][] = $GLOBALS['TL_LANG']['ERR']['invalidLogin'];
          $this->log('The account was not active yet (activation date: ' . $this->parseDate($GLOBALS['TL_CONFIG']['dateFormat'], $objUser->start) . ')', __METHOD__, TL_ACCESS);
          $this->redirectTo403();
        }

        if (strlen($objUser->stop) && $objUser->stop < $time)
        {
          $blnAccountError = true;

          $_SESSION['TL_ERROR'][] = $GLOBALS['TL_LANG']['ERR']['invalidLogin'];
          $this->log('The account was not active anymore (deactivation date: ' . $this->parseDate($GLOBALS['TL_CONFIG']['dateFormat'], $objUser->stop) . ')', __METHOD__, TL_ACCESS);
          $this->redirectTo403();
        }
      }

      // Redirect to login screen if there is an error
      if ($blnAccountError)
      {
          return false;
      }

      $this->loginUser($objUser);

    }




  }
38404
public function generateFiles()
    {
        foreach ($this->getFiles() as $stub => $file) {
            $path = $this->module->getModulePath($this->getName()) . $file;

            if (!$this->filesystem->isDirectory($dir = dirname($path))) {
                $this->filesystem->makeDirectory($dir, 0775, true);
            }

            $this->filesystem->put($path, $this->getStubContents($stub));
        }
    }
341944
def process_modules(modules):
    '''
    '''
    for mod in modules['client']:
        directory = '%s/client_modules' % HERE
        if not exists(directory):
            makedirs(directory)
        write_module_file(mod, directory, 'pyeapi')

    for mod in modules['api']:
        directory = '%s/api_modules' % HERE
        if not exists(directory):
            makedirs(directory)
        write_module_file(mod, directory, 'pyeapi.api')

    create_index(modules)
1234317
public String generateIf(Module module) {
        return generateIf(config.getCelerio().getConfiguration().has(module));
    }
1141523
protected function generateModule()
    {
        $location = $this->container['location'];
        $root     = module_path(null, '', $location);
        $manifest = config("modules.locations.$location.manifest") ?: 'module.json';
        $provider = config("modules.locations.$location.provider") ?: 'ModuleServiceProvider';

        if (!$this->files->isDirectory($root)) {
            $this->files->makeDirectory($root);
        }

        $mapping   = config("modules.locations.$location.mapping");
        $directory = module_path(null, $this->container['basename'], $location);
        $source    = __DIR__ . '/../../../resources/stubs/module';

        $this->files->makeDirectory($directory);

        $sourceFiles = $this->files->allFiles($source, true);

        if (!empty($mapping)) {
            $search = array_keys($mapping);
            $replace = array_values($mapping);
        }

        foreach ($sourceFiles as $file) {
            $contents = $this->replacePlaceholders($file->getContents());
            $subPath = $file->getRelativePathname();

            if (!empty($mapping)) {
                $subPath = str_replace($search, $replace, $subPath);
            }

            $filePath = $directory . '/' . $subPath;
            
            // if the file is module.json, replace it with the custom manifest file name
            if ($file->getFilename() === 'module.json' && $manifest) {
                $filePath = str_replace('module.json', $manifest, $filePath);
            }
            
            // if the file is ModuleServiceProvider.php, replace it with the custom provider file name
            if ($file->getFilename() === 'ModuleServiceProvider.php') {
                $filePath = str_replace('ModuleServiceProvider', $provider, $filePath);
            }
            
            $dir = dirname($filePath);
            
            if (! $this->files->isDirectory($dir)) {
                $this->files->makeDirectory($dir, 0755, true);
            }

            $this->files->put($filePath, $contents);
        }
    }
888461
function generate() {
    var parsed = ensureConfig();
    if (!parsed.name)
        mu.log.error('cannot generate template using name of undefined.\n').write().exit();
    // Generate the template.
    mu.render(parsed.name, parsed.output, parsed.options);
}
1224769
def generate_sample_module(module_dir):
    """"""
    if os.path.isdir(module_dir):
        LOGGER.error("Error generating sample module -- directory %s "
                     "already exists!",
                     module_dir)
        sys.exit(1)
    os.mkdir(module_dir)
522113
def generate_cxx(module_name, code, specs=None, optimizations=None,
                 module_dir=None):
    '''

    '''

    pm, ir, renamings, docstrings = front_middle_end(module_name, code,
                                                     optimizations, module_dir)

    # back-end
    content = pm.dump(Cxx, ir)

    # instantiate the meta program
    if specs is None:

        class Generable(object):
            def __init__(self, content):
                self.content = content

            def __str__(self):
                return str(self.content)

            generate = __str__

        mod = Generable(content)

        def error_checker():
            tog.typecheck(ir)

    else:

        # uniform typing
        if isinstance(specs, dict):
            specs = Spec(specs, {})

        def error_checker():
            types = tog.typecheck(ir)
            check_specs(specs, renamings, types)

        specs.to_docstrings(docstrings)
        check_exports(ir, specs, renamings)

        if isinstance(code, bytes):
            code_bytes = code
        else:
            code_bytes = code.encode('ascii', 'ignore')
        metainfo = {'hash': hashlib.sha256(code_bytes).hexdigest(),
                    'version': __version__,
                    'date': datetime.now()}

        mod = PythonModule(module_name, docstrings, metainfo)
        mod.add_to_includes(
            Include("pythonic/core.hpp"),
            Include("pythonic/python/core.hpp"),
            # FIXME: only include these when needed
            Include("pythonic/types/bool.hpp"),
            Include("pythonic/types/int.hpp"),
            Line("#ifdef _OPENMP\n#include <omp.h>\n#endif")
        )
        mod.add_to_includes(*[Include(inc) for inc in
                              _extract_specs_dependencies(specs)])
        mod.add_to_includes(*content.body)
        mod.add_to_includes(
            Include("pythonic/python/exception_handler.hpp"),
        )

        def warded(module_name, internal_name):
            return pythran_ward + '{0}::{1}'.format(module_name, internal_name)

        for function_name, signatures in specs.functions.items():
            internal_func_name = renamings.get(function_name,
                                               function_name)
            # global variables are functions with no signatures :-)
            if not signatures:
                mod.add_global_var(function_name,
                                   "{}()()".format(warded(module_name,
                                                          internal_func_name)))

            for sigid, signature in enumerate(signatures):
                numbered_function_name = "{0}{1}".format(internal_func_name,
                                                         sigid)
                arguments_types = [pytype_to_ctype(t) for t in signature]
                arguments_names = HasArgument(internal_func_name).visit(ir)
                arguments = [n for n, _ in
                             zip(arguments_names, arguments_types)]
                name_fmt = pythran_ward + "{0}::{1}::type{2}"
                args_list = ", ".join(arguments_types)
                specialized_fname = name_fmt.format(module_name,
                                                    internal_func_name,
                                                    "<{0}>".format(args_list)
                                                    if arguments_names else "")
                result_type = "typename %s::result_type" % specialized_fname
                mod.add_pyfunction(
                    FunctionBody(
                        FunctionDeclaration(
                            Value(
                                result_type,
                                numbered_function_name),
                            [Value(t + '&&', a)
                             for t, a in zip(arguments_types, arguments)]),
                        Block([Statement("""
                            PyThreadState *_save = PyEval_SaveThread();
                            try {{
                                auto res = {0}()({1});
                                PyEval_RestoreThread(_save);
                                return res;
                            }}
                            catch(...) {{
                                PyEval_RestoreThread(_save);
                                throw;
                            }}
                            """.format(warded(module_name,
                                              internal_func_name),
                                       ', '.join(arguments)))])
                    ),
                    function_name,
                    arguments_types,
                    signature
                )

        for function_name, signature in specs.capsules.items():
            internal_func_name = renamings.get(function_name,
                                               function_name)

            arguments_types = [pytype_to_ctype(t) for t in signature]
            arguments_names = HasArgument(internal_func_name).visit(ir)
            arguments = [n for n, _ in
                         zip(arguments_names, arguments_types)]
            name_fmt = pythran_ward + "{0}::{1}::type{2}"
            args_list = ", ".join(arguments_types)
            specialized_fname = name_fmt.format(module_name,
                                                internal_func_name,
                                                "<{0}>".format(args_list)
                                                if arguments_names else "")
            result_type = "typename %s::result_type" % specialized_fname
            docstring = spec_to_string(function_name, signature)
            mod.add_capsule(
                FunctionBody(
                    FunctionDeclaration(
                        Value(result_type, function_name),
                        [Value(t, a)
                         for t, a in zip(arguments_types, arguments)]),
                    Block([ReturnStatement("{0}()({1})".format(
                        warded(module_name, internal_func_name),
                        ', '.join(arguments)))])
                ),
                function_name,
                docstring
            )

    return mod, error_checker
362941
def generate(schema_file, all_options):
    ''''''
    schema = load_schema_file(open(schema_file, 'r'))
    config_parser = generate_config_parser(schema, include_all=all_options)
    config_parser.write(sys.stdout)
666638
public function generate()
    {
        $output = $this->generateIdeHelperOutput();
        $this->writeIdeHelperFile($output, '.ide-helper.php');

        $outputForPhpStormIde = $this->generatePhpStormIdeHelperOutput();
        $this->writeIdeHelperFile($outputForPhpStormIde, '.phpstorm.meta.php/oxid.meta.php');
    }
778047
public function generate(): void
    {
        $this->filesystem->mkdir($this->getDirectories());

        foreach ($this->getFiles() as $filePath => $fileContent) {
            $this->filesystem->dumpFile($filePath, $fileContent);
        }

        $this->filesystem->remove($this->clean());
    }
492638
public function generate()
    {
        /*write operation ->*/
        $writeTmp = fopen(
            $this->applicationDir.DS.'Controllers'.DS.$this->controller.'Controller'.EXT,
            'w'
        ) or die('Unable to generate controller');

        $contentAppendWith = '<?php '.PHP_EOL;

        fwrite($writeTmp, $contentAppendWith.$this->replacedContent);
        fclose($writeTmp);
        fclose($this->filePointer);
    }
502039
def generate(self):
        """"""
        for root, _, files in os.walk(self.source_dir):
            for fname in files:
                source_fpath = os.path.join(root, fname)
                self.generate_api_for_source(source_fpath)
14265
protected function create_course_module() {
        global $CFG;
        require_once($CFG->dirroot.'/course/modlib.php');
        list($module, $context, $cw, $cm, $data) = prepare_new_moduleinfo_data($this->course, $this->module->name, $this->section);

        $data->coursemodule = $data->id = add_course_module($data);
        $this->cm = $data;
    }
929082
def add_module(self, module):
        '''
        
        '''
        for key, value in module.__dict__.iteritems():
            if key[0:2] != '__':
                self.__setattr__(attr=key, value=value)
20278
def module(args):
    "  "

    mod = op.join(settings.MOD_DIR, args.MODULE)
    assert op.exists(mod), "Not found module: %s" % args.MODULE
    if not args.DEST.startswith(op.sep):
        args.DEST = op.join(getcwd(), args.DEST)
    print_header("Copy module source")
    copytree(mod, args.DEST)
247869
def generate(self):
        
        s = self._docstring
        s += self._get_source().replace(
            'endpoints = {}',
            'endpoints = ' + self._config_src
        ).replace(
            'logger.setLevel(logging.INFO)',
            'logger.setLevel(logging.%s)' % self.config.logging_level
        )
        return s