Runs the basic hug development server against this API
504307
def serve(self, host='', port=8000, no_documentation=False, display_intro=True):
        """"""
        if no_documentation:
            api = self.server(None)
        else:
            api = self.server()

        if display_intro:
            print(INTRO)

        httpd = make_server(host, port, api)
        print("Serving on {0}:{1}...".format(host, port))
        httpd.serve_forever()
698087
def run_app
      http_config = config.http

      @server_thread = Thread.new do
        @server = Puma::Server.new(app)
        begin
          @server.add_tcp_listener(http_config.host, http_config.port.to_i)
        rescue Errno::EADDRINUSE, Errno::EACCES => e
          logger.fatal I18n.t(
            "lita.http.exception",
            message: e.message,
            backtrace: e.backtrace.join("\n")
          )
          abort
        end
        @server.min_threads = http_config.min_threads
        @server.max_threads = http_config.max_threads
        @server.run
      end

      @server_thread.abort_on_exception = true
    end
1281220
def run():
    """"""
    
    # Grab server args
    args = client_helper.grab_server_args()

    # Start up workbench connection
    workbench = zerorpc.Client(timeout=300, heartbeat=60)
    workbench.connect('tcp://'+args['server']+':'+args['port'])

    # Upload the files into workbench
    my_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                           '../data/pcap/gold_xxx.pcap')
    with open(my_file,'rb') as f:

        # We're going to upload the file in chunks to workbench 
        filename = os.path.basename(my_file)
        raw_bytes = f.read()
        md5_list = []
        for chunk in chunks(raw_bytes, 1024*1024):
            md5_list.append(workbench.store_sample(chunk, filename, 'exe'))

        # Now we just ask Workbench to combine these
        combined_md5 = workbench.combine_samples(md5_list, filename, 'exe')
        real_md5 = workbench.store_sample(raw_bytes, filename, 'exe')
        assert(combined_md5 == real_md5)
274452
def runserver(ctx, conf, port, foreground):
    """"""
    config = read_config(conf)

    debug = config['conf'].get('debug', False)
    click.echo('Debug mode {0}.'.format('on' if debug else 'off'))

    port = port or config['conf']['server']['port']

    app_settings = {
        'debug': debug,
        'auto_reload': config['conf']['server'].get('auto_reload', False),
    }
    handlers_settings = __create_handler_settings(config)

    if foreground:
        click.echo('Requested mode: foreground')
        start_app(port, app_settings, handlers_settings)
    else:
        click.echo('Requested mode: background')
        # subprocess.call([sys.executable, 'yourscript.py'], env=os.environ.copy())
        raise NotImplementedError
589821
function HyperServer($){

    //setup
    $ = Object.assign( defaults, $ ); 

    //injection
    let gx   = $.generator;
    let hx   = $.handler;

    //prototype
    let $ns, $n = proto();
    let dev  = ( 'development' == $n.get('env') || process.env.NODE_ENV  == 'development' );
    let port = (( dev ? $.LOCAL_PORT : $.APP_PORT ) || process.env.NODE_PORT );
 
    //config mapping
    $n.set( 'port', port );
    $n.set( 'view engine', $.VIEW_ENGINE );

    //middleware in out next
    if( dev ) $n.use( errorHandler({ dumpExceptions: true, showStack: true }) );
    $n.use( bodyParser.json() );
    $n.use( bodyParser.urlencoded({ extended:true }) );
    $n.use( override() );
    $n.use( cookieParser() );
    $n.use( sss({secret: 'secret', key:$.SESSION_ID, resave:true, saveUninitialized:true }));
    $n.use( ( i, o, n ) => { o.set('X-Powered-By', $.SERVER_ID ); n(); });
    $n.use( ( i, o, n ) => { i.baseUrl = i.originalUrl.split("?").shift(); n(); });
    $n.use( ( i, o, n ) => { console.info( `[${i.method} ${i.baseUrl}]`) || n(); }); //| q:${k(i.query)} \t | c:${k(i.cookies)}` ) || n(); });
    $n.use( favicon( $.PUBLIC_WWW + '/favicon.ico') );
    $n.use( proto.static( $.PUBLIC_WWW, {  
        setHeaders: ( res, path, stat ) => res.set('X-Timestamp', Date.now())
    }));

    //route stubs
    $.router.route( $n );

    //boot
    $ns = http.createServer($n)
          .on( 'close', ()=> {
            console.error( $.SERVER_ID + " - Shutting Down..");
          })
          .listen( port, data => {
            console.info( `Env  : [ ${( dev ? "DEV" : "UAT" )} ] \nPort : [ ${port} ]` );
            console.info( `URL  :  http://localhost:${port}` );
          });

    //termsigs
    process.once( 'SIGUSR2', ()=> {
            console.warn( 'Attempting to graceful kill...' );
            process.kill( process.pid, 'SIGUSR2');
          })
          .once( 'EADDRINUSE', ()=> {
            console.warn( 'Required port unavailable' );
            process.exit(1);
          });

    return $n;
  }
1001741
def main():
    

    print("Ontospy " + VERSION)

    Shell()._clear_screen()
    print(Style.BRIGHT + "** Ontospy Interactive Ontology Browser " + VERSION + " **" + Style.RESET_ALL)
    # manager.get_or_create_home_repo()
    Shell().cmdloop()
    raise SystemExit(1)
993693
def run(self):
        
        print("Development server started on http://%s:%s. \n\nPress Ctrl+C to stop\n" % (
            self.manager.args.addr,
            self.manager.args.port)
              )
        if self.manager.args.server_type == 'falcon':
            self.run_with_falcon()
        elif self.manager.args.server_type == 'tornado':
            self.run_with_tornado()
586297
def run(self, app):
        """"""
        GlimLog.info('Glim server started on %s environment' % self.args.env)
        try:
            kwargs = Config.get('app.server.options')
            run(app.wsgi,
                host=Config.get('app.server.host'),
                port=Config.get('app.server.port'),
                debug=Config.get('app.server.debugger'),
                reloader=Config.get('app.server.reloader'),
                server=Config.get('app.server.wsgi'),
                **kwargs)
        except Exception as e:
            print(traceback.format_exc())
            exit()
577252
function runWebServerInProcess(rawConfig, serverConfig, emitter) {
  var server = require('./server.js');
  
  if (serverConfig.command == 'stop') {
    logger.info('stopping server');
    return server.stop();
  }
  
  var app = server.listen(rawConfig, serverConfig, function(err, newCommandName, newConfig, finalCallback) {
    if (err) { 
      logger.error("Error: " + err);
      if (callback) callback(err);
    } else {
      emitter.emit(newCommandName, newConfig, finalCallback);
    }
  });
}
115039
def run(options):
    
    from google.appengine.tools import appengine_rpc
    from google.appengine.tools import appcfg

    source = 'furious'

    # use the same user agent that GAE uses in appcfg
    user_agent = appcfg.GetUserAgent()

    # Since we're only using the dev server for now we can hard code these
    # values. This will need to change and accept these values as variables
    # when this is wired up to hit appspots.
    server = appengine_rpc.HttpRpcServer(
        'localhost:8080', lambda: ('test@example.com', 'password'), user_agent,
        source, secure=False)

    # if no url is passed in just use the top level.
    url = "/"
    if options.url:
        url += options.url[0]

    # use the dev server authentication for now.
    server._DevAppServerAuthenticate()

    # send a simple GET request to the url
    server.Send(url, content_type="text/html; charset=utf-8",
                payload=None)
479736
def run():
    """"""
    args = parse_args()

    appname = sys.argv[0]
    hostname = platform.node()

    codetools.setup_logging(args.debug)

    password = ''

    if args.token_path is None and args.delete_role is True:
        cred_path = os.path.expanduser('~/.sq_github_token_delete')
    elif args.token_path is None and args.delete_role is False:
        cred_path = os.path.expanduser('~/.sq_github_token')
    else:
        cred_path = os.path.expandvars(os.path.expanduser(args.token_path))

    if not os.path.isfile(cred_path):
        print("""
        Type in your password to get an auth token from github
        It will be stored in {0}
        and used in subsequent occasions.
        """.format(cred_path))

        while not password:
            password = getpass('Password for {0}: '.format(args.user))

        note = textwrap.dedent("""\
            {app} via bored^H^H^H^H^H terrified opossums[1]
            on {host}
            by {user} {creds}
            [1] https://youtu.be/ZtLrn2zPTxQ?t=1m10s
            """).format(
            app=appname,
            host=hostname,
            user=args.user,
            creds=cred_path
        )
        note_url = 'https://www.youtube.com/watch?v=cFvijBpzD_Y'

        if args.delete_role:
            scopes = ['repo', 'user', 'delete_repo', 'admin:org']
        else:
            scopes = ['repo', 'user']

        global g
        g = github.Github(args.user, password)
        u = g.get_user()

        try:
            auth = u.create_authorization(
                scopes=scopes,
                note=note,
                note_url=note_url,
            )
        except github.TwoFactorException:
            auth = u.create_authorization(
                scopes=scopes,
                note=note,
                note_url=note_url,
                # not a callback
                onetime_password=codetools.github_2fa_callback()
            )
        g = github.Github(auth.token)

        with open(cred_path, 'w') as fdo:
            fdo.write(auth.token + '\n')
            fdo.write(str(auth.id))

        print('Token written to {0}'.format(cred_path))

    else:
        print("You already have an auth file: {0} ".format(cred_path))
        print("Delete it if you want a new one and run again")
        print("Remember to also remove the corresponding token on Github")
715936
def run(self, **kwargs):
        

        try:
            loop = IOLoop()
            app = self.make_app()
            app.listen(self.port)
            loop.start()

        except socket.error as serr:
            # Re raise the socket error if not "[Errno 98] Address already in use"
            if serr.errno != errno.EADDRINUSE:
                raise serr
            else:
                logger.warning('The webserver port {} is already used. May be the HttpRobotServer is already running or another software is using this port.'.format(self.port))
1266511
def run(config):
    ""
    app = make_app(config=config)

    app.run(
            host=app.config.get("HOST", '127.0.0.1'),
            port=app.config.get("PORT", 5000),
            use_reloader=True,
            )
739894
def run(filepath, wsgiapp, host, port, reload, interval,
        static, static_root, static_dirs, lineprof, lineprof_file, validate):
    
    insert_import_path_to_sys_modules(filepath)
    module = SourceFileLoader('module', filepath).load_module()
    app = getattr(module, wsgiapp)

    if static:
        from wsgi_static_middleware import StaticMiddleware
        app = StaticMiddleware(app, static_root=static_root, static_dirs=static_dirs)

    if validate:
        from wsgiref.validate import validator
        app = validator(app)

    if lineprof:
        # Caution: wsgi-lineprof is still pre-alpha. Except breaking API Changes.
        from wsgi_lineprof.middleware import LineProfilerMiddleware
        from wsgi_lineprof.filters import FilenameFilter, TotalTimeSorter

        if lineprof_file:
            # Now wsgi-lineprof is now supported only 1 file checking.
            lineprof_file = lineprof_file[0]
        else:
            lineprof_file = os.path.basename(filepath)
        filters = [FilenameFilter(lineprof_file), TotalTimeSorter()]
        app = LineProfilerMiddleware(app, filters=filters)

    if reload:
        run_live_reloading_server(interval, app=app, host=host, port=port)
    else:
        run_server(app=app, host=host, port=port)
52484
def run(addr, port, wsgi_handler, ipv6=False, threading=False, **kwargs):
    
    logger.info('Websocket support is enabled')
    server_address = (addr, port)
    if not threading:
        raise Exception("Django's Websocket server must run with threading enabled")
    httpd_cls = type('WSGIServer', (socketserver.ThreadingMixIn, WSGIServer), {'daemon_threads': True})
    httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6)
    httpd.set_app(wsgi_handler)
    httpd.serve_forever()
772307
def run(self, handler):
        """"""
        import eventlet.patcher
        if not eventlet.patcher.is_monkey_patched(os):
            msg = ("%s requires eventlet.monkey_patch() (before "
                   "import)" % self.__class__.__name__)
            raise RuntimeError(msg)

        # Separate out wsgi.server arguments
        wsgi_args = {}
        for arg in ('log', 'environ', 'max_size', 'max_http_version',
                    'protocol', 'server_event', 'minimum_chunk_size',
                    'log_x_forwarded_for', 'custom_pool', 'keepalive',
                    'log_output', 'log_format', 'url_length_limit', 'debug',
                    'socket_timeout', 'capitalize_response_headers'):
            try:
                wsgi_args[arg] = self.options.pop(arg)
            except KeyError:
                pass
        if 'log_output' not in wsgi_args:
            wsgi_args['log_output'] = not self.quiet

        import eventlet.wsgi
        sock = self.options.pop('shared_socket', None) or self.get_socket()
        eventlet.wsgi.server(sock, handler, **wsgi_args)
330688
def run(self, host: str = '0.0.0.0', port: int = 8080):
        
        self._loop.run_until_complete(self._configure_plugins())
        web.run_app(self._app, host=host, port=port)