Prepare server to execute

    :return: Modules to execute, cmd line function
    :rtype: list[WrapperServer], callable | None
960102
def create(host, port):
    
    wrapper = WrapperEchoServer({
        'server': None
    })
    d = {
        'listen_port': port,
        'changer': wrapper
    }
    if host:
        d['listen_bind_ip'] = host

    ses = EchoServer(d)
    wrapper.server = ses
    return [wrapper], cmd_line
1265344
function prepareServe() {

  if (webpackServer) {
    return bindServe();
  } else {
    return new Promise((resolve, reject) => {
      portfinder.getPortPromise()
        .then(writeConfigServe)
        .then(bindServe)
        .then(resolve)
        .catch(err => reject(err));
    });
  }
}
478384
def prepare(cls, *args, **kwargs):
        
        cls.args = args
        cls.kwargs = kwargs
        cls.prepared = True
680514
def command_line_parsed(
            self,
            available_plugins: Set[Type[Plugin]],
            args_command_list: Any,
            malformed_servers: List[ServerStringParsingError]
    ) -> None:
        
106008
def _prepare(self):
        

        super(CommandServer, self)._prepare()

        # unregister all active plugins
        for plugin in registration.get_registered():
            registration.disable_plugin_instance(plugin)
565736
def exec_python(*args, **kwargs):
    
    cmdargs, kwargs = __wrap_python(args, kwargs)
    return exec_command(*cmdargs, **kwargs)
647899
def runserver(project_name):
	'''
	
	'''
	DIR = os.listdir(project_name)

	if 'settings.py' not in DIR:
		raise NotImplementedError('No file called: settings.py found in %s'%project_name)

	CGI_BIN_FOLDER = os.path.join(project_name, 'cgi', 'cgi-bin')
	CGI_FOLDER = os.path.join(project_name, 'cgi')
	if not os.path.exists(CGI_BIN_FOLDER):
		os.makedirs(CGI_BIN_FOLDER)

	os.chdir(CGI_FOLDER)
	subprocess.Popen("python -m http.server --cgi 8000")
396897
async def create_server(self, worker, protocol_factory, address=None,
                            sockets=None, idx=0):
        '''
        '''
        cfg = self.cfg
        max_requests = cfg.max_requests
        if max_requests:
            max_requests = int(lognormvariate(log(max_requests), 0.2))
        server = self.server_factory(
            protocol_factory,
            loop=worker._loop,
            max_requests=max_requests,
            keep_alive=cfg.keep_alive,
            name=self.name,
            logger=self.logger,
            server_software=cfg.server_software,
            cfg=cfg,
            idx=idx
        )
        for event in ('connection_made', 'pre_request', 'post_request',
                      'connection_lost'):
            callback = getattr(cfg, event)
            if callback != pass_through:
                server.event(event).bind(callback)
        await server.start_serving(
            sockets=sockets,
            address=address,
            backlog=cfg.backlog,
            sslcontext=self.sslcontext()
        )
        return server
413579
def prepare_command(self):
        
        try:
            cmdline_args = self.loader.load_file('args', string_types)
            self.command = shlex.split(cmdline_args.decode('utf-8'))
            self.execution_mode = ExecutionMode.RAW
        except ConfigurationError:
            self.command = self.generate_ansible_command()
835432
def execute(self):
        
        # Preprocess options to extract --settings and --pythonpath.
        # These options could affect the commands that are available, so they
        # must be processed early.
        parser = NewOptionParser(prog=self.prog_name,
                             usage=self.usage_info,
#                             version=self.get_version(),
                             formatter = NewFormatter(),
                             add_help_option = False,
                             option_list=self.option_list)

        options, args = parser.parse_args(self.argv)
        self.options = options
        if len(args) == 0:
            self.message("You should give at least one package name.", 'error')
            return

        subcommand = args[0]

        self.handle(args[1:], self.options, self.global_options, subcommand)
1341383
def server(port):
    """"""
    args = ['python', 'manage.py', 'runserver']
    if port:
        args.append(port)
    run.main(args)
411722
private void loadServerParameters() {
    
    serverParser.addArgument("-p", "--port")
        .required(true)
         .help("Port to be assigned to the server.\n");
    serverParser.addArgument("-m", "--model").required(true)
        .help("Choose parsing model.\n");
    serverParser
        .addArgument("-l", "--language")
        .choices("en", "es")
        .required(true)
        .help(
            "Choose language.\n");
    serverParser.addArgument("-g", "--headFinder")
        .choices("collins", "sem", Flags.DEFAULT_HEADFINDER)
        .setDefault(Flags.DEFAULT_HEADFINDER).required(false)
        .help("Choose between Collins or Semantic HeadFinder.\n");
    serverParser.addArgument("-o", "--outputFormat").choices("oneline", "naf")
        .setDefault(Flags.DEFAULT_OUTPUT_FORMAT).required(false)
        .help("Choose outputFormat; it defaults to NAF.\n");
  }
693613
def main():
    """"""
    parser = argparse.ArgumentParser(
        description='Start an instance of the Cheroot WSGI/HTTP server.',
    )
    for arg, spec in _arg_spec.items():
        parser.add_argument(arg, **spec)
    raw_args = parser.parse_args()

    # ensure cwd in sys.path
    '' in sys.path or sys.path.insert(0, '')

    # create a server based on the arguments provided
    raw_args._wsgi_app.server(raw_args).safe_start()
267775
def _set_callables(modules):
    '''
    
    '''
    def _set_function(cmd_name, doc):
        '''
        Create a Salt function for the Ansible module.
        '''
        def _cmd(*args, **kw):
            '''
            Call an Ansible module as a function from the Salt.
            '''
            kwargs = {}
            if kw.get('__pub_arg'):
                for _kw in kw.get('__pub_arg', []):
                    if isinstance(_kw, dict):
                        kwargs = _kw
                        break

            return _caller.call(cmd_name, *args, **kwargs)
        _cmd.__doc__ = doc
        return _cmd

    for mod in modules:
        setattr(sys.modules[__name__], mod, _set_function(mod, 'Available'))
278537
def make_handlers(base_url, server_processes):
    
    handlers = []
    for sp in server_processes:
        handler = _make_serverproxy_handler(
            sp.name,
            sp.command,
            sp.environment,
            sp.timeout,
            sp.absolute_url,
            sp.port,
        )
        handlers.append((
            ujoin(base_url, sp.name, r'(.*)'), handler, dict(state={}),
        ))
        handlers.append((
            ujoin(base_url, sp.name), AddSlashHandler
        ))
    return handlers
343370
def prepare(self, node):
        ''''''
        if isinstance(node, ast.Module):
            self.ctx.module = node
        elif isinstance(node, ast.FunctionDef):
            self.ctx.function = node

        for D in self.deps:
            d = D()
            d.attach(self.passmanager, self.ctx)
            result = d.run(node)
            setattr(self, uncamel(D.__name__), result)
324329
def _execute(self, *args: str, **kwargs: Any) -> tuple:
        ''''''
        return self.execute(args=args, options=merge_dict(self.options, kwargs)).communicate()