Run the agent, connecting to a (remote) host started independently.
177077
def agent():
  """"""
  agent_module, agent_name = FLAGS.agent.rsplit(".", 1)
  agent_cls = getattr(importlib.import_module(agent_module), agent_name)

  logging.info("Starting agent:")
  with lan_sc2_env.LanSC2Env(
      host=FLAGS.host,
      config_port=FLAGS.config_port,
      race=sc2_env.Race[FLAGS.agent_race],
      step_mul=FLAGS.step_mul,
      agent_interface_format=sc2_env.parse_agent_interface_format(
          feature_screen=FLAGS.feature_screen_size,
          feature_minimap=FLAGS.feature_minimap_size,
          rgb_screen=FLAGS.rgb_screen_size,
          rgb_minimap=FLAGS.rgb_minimap_size,
          action_space=FLAGS.action_space,
          use_feature_units=FLAGS.use_feature_units),
      visualize=FLAGS.render) as env:
    agents = [agent_cls()]
    logging.info("Connected, starting run_loop.")
    try:
      run_loop.run_loop(agents, env)
    except lan_sc2_env.RestartException:
      pass
  logging.info("Done.")
1323508
def run_command_on_agent(
        host,
        command,
        username=None,
        key_path=None,
        noisy=True
):
    

    return run_command(host, command, username, key_path, noisy)
537520
def run(host: Optional[str] = None, port: Optional[int] = None,
        *args, **kwargs) -> None:
    """"""
    get_bot().run(host=host, port=port, *args, **kwargs)
819531
public void run() {
        while(running.get()) {
            try {
                Thread.sleep(gossipInterval);
            } catch(InterruptedException e) {
                Thread.currentThread().interrupt();
            }
            Node node = selectPeer();
            adminClient.setAdminClientCluster(metadataStore.getCluster());

            if(logger.isDebugEnabled())
                logger.debug("Starting gossip with " + node);

            for(String key: MetadataStore.GOSSIP_KEYS) {
                try {
                    gossipKey(node, key);
                } catch(VoldemortException e) {
                    logger.warn("Unable to Gossip key " + key + " with " + node, e);
                }
            }
        }
    }
651843
def start_agent(agent_name, agent_class = Agent)
      # note that our Windows service monitors rnac and rchk processes
      # externally and restarts them if they die, so no need to roll our
      # own cross-monitoring on that platform.
      use_agent_watcher = !RightScale::Platform.windows?
      agent_watcher     = nil
      if use_agent_watcher
        agent_watcher = AgentWatcher.new( lambda { |s| Log.info(s) }, @options[:pid_dir] )
        agent_watcher.watch_agent("#{@options[:identity]}-rchk", '/opt/rightscale/bin/rchk', '--start', '--stop')
        @options[:ready_callback] = Proc.new { agent_watcher.start_watching() }
      end
      super
      agent_watcher.stop_watching if use_agent_watcher
    end
225056
def agent_run(args):
    
    run = wandb.wandb_run.Run.from_environment_or_defaults()
    run.enable_logging()

    api = wandb.apis.InternalApi()
    api.set_current_run_id(run.id)

    # TODO: better failure handling
    root = api.git.root
    # handle non-git directories
    if not root:
        root = os.path.abspath(os.getcwd())
        host = socket.gethostname()
        remote_url = 'file://{}{}'.format(host, root)

    run.save(program=args['program'], api=api)
    env = dict(os.environ)
    run.set_environment(env)

    try:
        rm = wandb.run_manager.RunManager(api, run)
    except wandb.run_manager.Error:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        wandb.termerror('An Exception was raised during setup, see %s for full traceback.' %
                        util.get_log_file_path())
        wandb.termerror(exc_value)
        if 'permission' in str(exc_value):
            wandb.termerror(
                'Are you sure you provided the correct API key to "wandb login"?')
        lines = traceback.format_exception(
            exc_type, exc_value, exc_traceback)
        logging.error('\n'.join(lines))
    else:
        rm.run_user_process(args['program'], args['args'], env)
1166525
def run(self, host="localhost", port=8000, shutdown_timeout=60.0, **kwargs):
        
        print("Running service on http://localhost:%i. " % port + \
                                            "Press Ctrl+C to terminate.")

        # apply the configuration to the service config
        self.config.port = port
        self.config.host = host

        # start the loop
        try:
            # if an event broker has been created for this service
            if self.event_broker:
                # start the broker
                self.event_broker.start()
                # announce the service
                self.loop.run_until_complete(self.announce())

            # the handler for the http server
            http_handler = self.app.make_handler()
            # create an asyncio server
            self._http_server = self.loop.create_server(http_handler, host, port)

            # grab the handler for the server callback
            self._server_handler = self.loop.run_until_complete(self._http_server)
            # start the event loop
            self.loop.run_forever()

        # if the user interrupted the server
        except KeyboardInterrupt:
            # keep going
            pass

        # when we're done
        finally:
            try:
                # clean up the service
                self.cleanup()
            # if we end up closing before any variables get assigned
            except UnboundLocalError:
                # just ignore it (there was nothing to close)
                pass

            # close the event loop
            self.loop.close()
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)
1032375
def agent():
  """"""
  agent_module, agent_name = FLAGS.agent.rsplit(".", 1)
  agent_cls = getattr(importlib.import_module(agent_module), agent_name)

  logging.info("Starting agent:")
  with remote_sc2_env.RemoteSC2Env(
      map_name=FLAGS.map,
      host=FLAGS.host,
      host_port=FLAGS.host_port,
      lan_port=FLAGS.lan_port,
      name=FLAGS.agent_name or agent_name,
      race=sc2_env.Race[FLAGS.agent_race],
      step_mul=FLAGS.step_mul,
      agent_interface_format=sc2_env.parse_agent_interface_format(
          feature_screen=FLAGS.feature_screen_size,
          feature_minimap=FLAGS.feature_minimap_size,
          rgb_screen=FLAGS.rgb_screen_size,
          rgb_minimap=FLAGS.rgb_minimap_size,
          action_space=FLAGS.action_space,
          use_feature_units=FLAGS.use_feature_units),
      visualize=FLAGS.render) as env:
    agents = [agent_cls()]
    logging.info("Connected, starting run_loop.")
    try:
      run_loop.run_loop(agents, env)
    except remote_sc2_env.RestartException:
      pass
  logging.info("Done.")
799609
def run
      if PryNav.current_remote_server
        raise 'Already running a pry-remote session!'
      else
        PryNav.current_remote_server = self
      end

      setup
      Pry.start @object, {
        :input  => client.input_proxy,
        :output => client.output,
        :pry_remote => true
      }
    end
576876
async def start_server_in_loop(runner, hostname, port, agent):
    
    await runner.setup()
    agent.web.server = aioweb.TCPSite(runner, hostname, port)
    await agent.web.server.start()
    logger.info(f"Serving on http://{hostname}:{port}/")
188412
def _run(self):
        """"""
        success = self.initialize()
        while success is None:
            success = self.propagate()
        return success
247676
def start(self):
        """"""
        if self.state != STATE_RUNNING:
            conn = self.loop.create_connection(
                lambda: self, self.host, self.port)
            task = self.loop.create_task(conn)
            task.add_done_callback(self.init_done)
            self.state = STATE_STARTING
80685
def _launch_remote(self, host, config_port, race, name, interface):
    """"""
    self._tcp_conn, settings = tcp_client(Addr(host, config_port))

    self._map_name = settings["map_name"]

    if settings["remote"]:
      self._udp_sock = udp_server(
          Addr(host, settings["ports"]["server"]["game"]))

      daemon_thread(tcp_to_udp,
                    (self._tcp_conn, self._udp_sock,
                     Addr(host, settings["ports"]["client"]["game"])))

      daemon_thread(udp_to_tcp, (self._udp_sock, self._tcp_conn))

    extra_ports = [
        settings["ports"]["server"]["game"],
        settings["ports"]["server"]["base"],
        settings["ports"]["client"]["game"],
        settings["ports"]["client"]["base"],
    ]

    self._sc2_procs = [self._run_config.start(
        extra_ports=extra_ports, host=host, version=settings["game_version"],
        window_loc=(700, 50), want_rgb=interface.HasField("render"))]
    self._controllers = [p.controller for p in self._sc2_procs]

    # Create the join request.
    join = sc_pb.RequestJoinGame(options=interface)
    join.race = race
    join.player_name = name
    join.shared_port = 0  # unused
    join.server_ports.game_port = settings["ports"]["server"]["game"]
    join.server_ports.base_port = settings["ports"]["server"]["base"]
    join.client_ports.add(game_port=settings["ports"]["client"]["game"],
                          base_port=settings["ports"]["client"]["base"])

    self._controllers[0].save_map(settings["map_path"], settings["map_data"])
    self._controllers[0].join_game(join)
901880
async def start(self):
        """"""

        self._command_task.start()

        try:
            await self._cleanup_old_connections()
        except Exception:
            await self.stop()
            raise

        #FIXME: This is a temporary hack, get the actual device we are serving.
        iotile_id = next(iter(self.adapter.devices))
        self.device = self.adapter.devices[iotile_id]

        self._logger.info("Serving device 0x%04X over BLED112", iotile_id)
        await self._update_advertisement()

        self.setup_client(self.CLIENT_ID, scan=False, broadcast=True)
477931
def run(self, cmd, user='root', sudo=False, ignore_error=False,
            success_status=(0,), error_callback=None, custom_log=None, retry=0):
        
        self.enable_user(user)
        return self.ssh_pool.run(
            user, cmd, sudo=sudo, ignore_error=ignore_error,
            success_status=success_status, error_callback=error_callback,
            custom_log=custom_log, retry=retry)
1210171
public function start()
    {
        if ($this->started) {
            return;
        }

        $auth = $this->getAuthFlag();

        $command = 'transmission-remote -C ' . $auth
            . ' -' . ($this->encryption ? 'er' : 'ep')
            . ' -p ' . $this->port
            . ' -' . ($this->upnp ? 'm' : 'M')
            . ($this->downloadPath ? ' -w ' . $this->downloadPath : '');
        $this->execute($command);

        $this->execute('transmission-remote ' . $auth . ' -l');
        if ($this->getStatus() == 1) {
            $this->execute('transmission-daemon');
        }

        $this->started = true;
    }