Create a new {@link Stations} instance that uses the given `agent` to
make its HTTP requests to the ESI interface.

@param agent The agent making actual requests
@returns An Stations API instance
961927
function makeStations(agent) {
    let functor = function (id) {
        return new StationImpl(agent, id);
    };
    functor.search = search_1.makeDefaultSearch(agent, "station" /* STATION */);
    functor.names = function (ids) {
        return names_1.getNames(agent, "station" /* STATION */, ids);
    };
    return functor;
}
447756
public static void createAgent (
        ClientObject target, int arg1)
    {
        sendNotification(
            target, BureauDecoder.RECEIVER_CODE, BureauDecoder.CREATE_AGENT,
            new Object[] { Integer.valueOf(arg1) });
    }
1008327
public ApiSuccessResponse getAgentHistory(AgentHistoryData agentHistoryData) throws ApiException {
        ApiResponse<ApiSuccessResponse> resp = getAgentHistoryWithHttpInfo(agentHistoryData);
        return resp.getData();
    }
1095673
public void startAgent (AgentObject agent)
    {
        agent.setLocal(AgentData.class, new AgentData());

        Bureau bureau = _bureaus.get(agent.bureauId);
        if (bureau != null && bureau.ready()) {
            _omgr.registerObject(agent);

            log.info("Bureau ready, sending createAgent", "agent", agent.which());
            BureauSender.createAgent(bureau.clientObj, agent.getOid());
            bureau.agentStates.put(agent, AgentState.STARTED);
            bureau.summarize();
            return;
        }

        if (bureau == null) {
            LauncherEntry launcherEntry = _launchers.get(agent.bureauType);
            if (launcherEntry == null) {
                log.warning("Launcher not found", "agent", agent.which());
                return;
            }

            log.info("Creating new bureau", "bureauId", agent.bureauId, "launcher", launcherEntry);
            bureau = new Bureau();
            bureau.bureauId = agent.bureauId;
            bureau.token = generateToken(bureau.bureauId);
            bureau.launcherEntry = launcherEntry;
            _invoker.postUnit(new LauncherUnit(bureau, _omgr));
            _bureaus.put(agent.bureauId, bureau);
        }

        _omgr.registerObject(agent);
        bureau.agentStates.put(agent, AgentState.PENDING);

        log.info("Bureau not ready, pending agent", "agent", agent.which());
        bureau.summarize();
    }
1326062
private static HeaderProvider buildHeaderProvider(String userAgent){
    return FixedHeaderProvider.create(USER_AGENT_KEY.name(), VENEER_ADAPTER + userAgent);
  }
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.")
1218276
function Agent(options) {
  EventEmitter.call(this);
  this.setMaxListeners(0);

  options = assign({}, options);

  this._settings = options.settings;
  this._log = (options.log || defaultLogger).child({ component: 'http' });
  this.endpoints = {};

  // * Using an own HTTPS agent, because the global agent does not look at `NPN/ALPNProtocols` when
  //   generating the key identifying the connection, so we may get useless non-negotiated TLS
  //   channels even if we ask for a negotiated one. This agent will contain only negotiated
  //   channels.
  options.ALPNProtocols = supportedProtocols;
  options.NPNProtocols = supportedProtocols;
  this._httpsAgent = new https.Agent(options);

  this.sockets = this._httpsAgent.sockets;
  this.requests = this._httpsAgent.requests;
}
240122
function onRequestCreateAgent(session, channel, message) {
  var agent = agents.createAgent(channel, message.body)
  channel.addAgent(agent)

  channel.sendMessage({
    type:  "response",
    name:  message.name,
    from:  message.to,
    id:    message.id,
    body:  agent.info
  })
}
340302
def agent
      @agent ||= Sawyer::Agent.new(endpoint, sawyer_options) do |http|
        http.headers[:accept] = default_media_type
        http.headers[:content_type] = "application/json"
        http.headers[:user_agent] = user_agent
        if basic_authenticated?
          http.basic_auth(@login, @password)
        elsif token_authenticated?
          http.authorization 'token', @access_token
        elsif bearer_authenticated?
          http.authorization 'Bearer', @bearer_token
        elsif application_authenticated?
          http.params = http.params.merge application_authentication
        end
      end
    end
612816
public Agent newAgent(QualifiedName id, Collection<Attribute> attributes) {
	Agent res = newAgent(id);
	setAttributes(res, attributes);
	return res;
    }
664707
function Channel_delAgent(agent) {
  if (this.agents.get(agent.info.id) == null) return

  DEBUG("channel.delAgent(" + utils.JS(agent.info) + ")")
  this.agents.delete(agent.info.id)
  this.session.sendEvent("agentDestroyed", "server", agent.info)
}
300571
private CreateRoomSettings createRoomSettings(ApiRoom agent) {
        validateRoomAgentClass(agent);
	    CreateRoomSettings settings = new CreateRoomSettings();
        settings.setName(agent.getName());
        settings.setPassword(agent.getPassword());
        settings.setDynamic(agent.isDynamic());
        settings.setGame(agent.isGame());
        settings.setHidden(agent.isHidden());
        settings.setMaxSpectators(agent.getMaxSpectators());
        settings.setMaxUsers(agent.getMaxUsers());
        settings.setMaxVariablesAllowed(agent.getMaxRoomVariablesAllowed());
        settings.setRoomProperties(agent.getProperties());
        settings.setGroupId(agent.getGroupdId());
        settings.setUseWordsFilter(agent.isUseWordsFilter());
        settings.setAutoRemoveMode(SFSRoomRemoveMode.fromString(agent.getRemoveMode().name()));
        if(agent.getExtension() != null) 
            settings.setExtension(new RoomExtensionSettings(agent.getExtension().getName(), agent.getExtension().getClazz()));
        return settings;
	}
315073
def new_mapper(agent):
    """"""
    recp = recipient.Broadcast(MappingUpdatesPoster.protocol_id, 'lobby')
    return agent.initiate_protocol(MappingUpdatesPoster, recp)
1148110
function makeOpportunities(agent) {
    let groups = function (id) {
        if (id === undefined) {
            return agent.request('get_opportunities_groups', undefined);
        }
        else {
            return new GroupImpl(agent, id);
        }
    };
    let tasks = function (id) {
        if (id === undefined) {
            return agent.request('get_opportunities_tasks', undefined);
        }
        else {
            return new TaskImpl(agent, id);
        }
    };
    return { groups, tasks };
}
750576
def host_agent_available?
      @discovered ||= run_discovery

      if @discovered
        # Try default location or manually configured (if so)
        uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/")
        req = Net::HTTP::Get.new(uri)

        response = make_host_agent_request(req)

        if response && (response.code.to_i == 200)
          return true
        end
      end
      false
    rescue => e
      Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
      Instana.logger.debug e.backtrace.join("\r\n") unless ::Instana.test?
      return false
    end
725375
def channels_voice_agent_ticket_display_create(self, agent_id, ticket_id, data, **kwargs):
        ""
        api_path = "/api/v2/channels/voice/agents/{agent_id}/tickets/{ticket_id}/display.json"
        api_path = api_path.format(agent_id=agent_id, ticket_id=ticket_id)
        return self.call(api_path, method="POST", data=data, **kwargs)
1096297
public static ApiRoom getRoomAgent(Room sfsRoom) {
        Object roomAgent = sfsRoom.getProperty(APIKey.ROOM);
        if(roomAgent == null) 
            throw new RuntimeException("Can not get user agent");
        return (ApiRoom)roomAgent;
    }