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

@param agent The agent making actual requests
@returns An Types API instance
345985
function makeTypes(agent) {
    const allTypes = page_loader_1.makePageBasedLoader(page => agent.request('get_universe_types', { query: { page: page } }));
    const allGroups = page_loader_1.makePageBasedLoader(page => agent.request('get_universe_groups', { query: { page: page } }));
    let types = function (id) {
        if (id === undefined) {
            return allTypes.getAll();
        }
        else {
            return new TypeImpl(agent, id);
        }
    };
    types.categories = function (id) {
        if (id === undefined) {
            return agent.request('get_universe_categories', undefined);
        }
        else {
            return new CategoryImpl(agent, id);
        }
    };
    types.marketGroups = function (id) {
        if (id === undefined) {
            return agent.request('get_markets_groups', undefined);
        }
        else {
            return new MarketGroupImpl(agent, id);
        }
    };
    types.groups = function (id) {
        if (id === undefined) {
            return allGroups.getAll();
        }
        else {
            return new GroupImpl(agent, id);
        }
    };
    types.search = search_1.makeDefaultSearch(agent, "inventorytype" /* INVENTORYTYPE */);
    types.prices = function () {
        return agent.request('get_markets_prices', undefined);
    };
    types.names = function (ids) {
        if (ids === undefined) {
            return types().then(allIds => types.names(allIds));
        }
        else {
            return names_1.getNames(agent, "inventory_type" /* INVENTORY_TYPE */, ids);
        }
    };
    return types;
}
903997
public static Types instance(Context context) {
        Types instance = context.get(typesKey);
        if (instance == null)
            instance = new Types(context);
        return instance;
    }
1128997
public Agent newAgent(QualifiedName ag, String label) {
	Agent res = newAgent(ag);
	if (label != null)
	    res.getLabel().add(newInternationalizedString(label));
	return res;
    }
514710
public void typeMissing() {
		this.parameterMissing(
				ProtocolConstants.Parameters.Create.TYPE,
				"Please provide the type of the create request. Use \""
						+ CreateRequestType.USER.getIdentifier()
						+ "\" to create a user, \""
						+ CreateRequestType.FOLLOW.getIdentifier()
						+ "\" to create a follow edge or \""
						+ CreateRequestType.STATUS_UPDATE.getIdentifier()
						+ "\" to create a status update.");
	}
540073
public void registerShanksAgent(ShanksAgent agent)
            throws ShanksException {
        if (!this.agents.containsKey(agent.getID())) {
            this.agents.put(agent.getID(), agent);
        } else {
            throw new DuplicatedAgentIDException(agent.getID());
        }
    }
1070705
public TransportApiResult<List<Agency>> getAgencies(AgencyQueryOptions options)
    {
    	if (options == null)
    	{
    		options = AgencyQueryOptions.defaultQueryOptions();
    	}
    	
    	return TransportApiClientCalls.getAgencies(tokenComponent, settings, options, null, null, null);
    }
1027050
def get_create_agent(agent_kwargs):
  

  def create_agent(sess, environment, summary_writer=None):
    """Creates a DQN agent.

    Simplified version of `dopamine.discrete_domains.train.create_agent`

    Args:
      sess: a session
      environment: an environment
      summary_writer: a summary writer.

    Returns:
      a DQN agent.
    """
    return BatchDQNAgent(
        env_batch_size=environment.batch_size,
        sess=sess,
        num_actions=environment.action_space.n,
        summary_writer=summary_writer,
        tf_device="/gpu:*",
        **agent_kwargs)

  return create_agent
365558
function(agent, id, type, pid, info, socket) {
  let record = {
    id: id,
    type: type,
    pid: pid,
    info: info,
    socket: socket
  };
  if (type === 'client') {
    agent.clients[id] = record;
  } else {
    if (!agent.idMap[id]) {
      agent.idMap[id] = record;
      let list = agent.typeMap[type] = agent.typeMap[type] || [];
      list.push(record);
    } else {
      let slaves = agent.slaveMap[id] = agent.slaveMap[id] || [];
      slaves.push(record);
    }
  }
  return record;
}
908205
protected void _generate(SarlAgent agent, IExtraLanguageGeneratorContext context) {
		final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(agent);
		final PyAppendable appendable = createAppendable(jvmType, context);
		final List<JvmTypeReference> superTypes;
		if (agent.getExtends() != null) {
			superTypes = Collections.singletonList(agent.getExtends());
		} else {
			superTypes = Collections.singletonList(getTypeReferences().getTypeForName(Agent.class, agent));
		}
		final String qualifiedName = this.qualifiedNameProvider.getFullyQualifiedName(agent).toString();
		if (generateTypeDeclaration(
				qualifiedName,
				agent.getName(), agent.isAbstract(), superTypes,
				getTypeBuilder().getDocumentation(agent),
				true,
			agent.getMembers(), appendable, context, (it, context2) -> {
				generateGuardEvaluators(qualifiedName, it, context2);
			})) {
			final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(agent);
			writeFile(name, appendable, context);
		}
	}
959381
def make_host_agent_request(req)
      req['Accept'] = MIME_JSON
      req['Content-Type'] = MIME_JSON

      if @state == :unannounced
        @httpclient = Net::HTTP.new(req.uri.hostname, req.uri.port)
        @httpclient.open_timeout = 1
        @httpclient.read_timeout = 1
      end

      response = @httpclient.request(req)
      # ::Instana.logger.debug "#{req.method}->#{req.uri} body:(#{req.body}) Response:#{response} body:(#{response.body})"

      response
    rescue Errno::ECONNREFUSED
      return nil
    rescue => e
      Instana.logger.debug "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
      Instana.logger.debug e.backtrace.join("\r\n") unless ::Instana.test?
      return nil
    end
1146643
function Browser(type, options = {}) {
  if (!(this instanceof Browser)) return new Browser(type, options);
  EventEmitter.call(this);

  // convert argument ServiceType to validate it (might throw)
  const serviceType = (type instanceof ServiceType) ? type : new ServiceType(type);

  // can't search for multiple subtypes at the same time
  if (serviceType.subtypes.length > 1) {
    throw new Error('Too many subtypes. Can only browse one at a time.');
  }

  this._id = serviceType.toString();
  debug(`Creating new browser for "${this._id}"`);

  this._resolvers    = {}; // active service resolvers (when browsing services)
  this._serviceTypes = {}; // active service types (when browsing service types)
  this._protocol     = serviceType.protocol;
  this._serviceName  = serviceType.name;
  this._subtype      = serviceType.subtypes[0];
  this._isWildcard   = serviceType.isEnumerator;
  this._domain       = options.domain || 'local.';
  this._maintain     = ('maintain' in options) ? options.maintain : true;
  this._resolve      = ('resolve' in options) ? options.resolve : true;
  this._interface    = NetworkInterface.get(options.interface);
  this._state        = STATE.STOPPED;

  // emitter used to stop child queries instead of holding onto a reference
  // for each one
  this._offswitch = new EventEmitter();
}
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;
}
1069692
function mixinProxying(agent, proxyOpts) {
  agent.proxy = proxyOpts;

  var orig = _.pick(agent, 'createConnection', 'addRequest');

  // Make the tcp or tls connection go to the proxy, ignoring the
  // destination host:port arguments.
  agent.createConnection = function(port, host, options) {
    return orig.createConnection.call(this,
                                      this.proxy.port, this.proxy.host, options);
  };

  // tell the proxy where we really want to go by fully-qualifying the path
  // part. Force a localAddress if one was configured
  agent.addRequest = function(req, host, port, localAddress) {
    req.path = this.proxy.innerProtocol + '//' + host + ':' + port + req.path;
    if (this.proxy.localAddress) {
      localAddress = this.proxy.localAddress;
    }
    return orig.addRequest.call(this, req, host, port, localAddress);
  };
}
1095863
protected static io.grpc.netty.NegotiationType of(final NegotiationType negotiationType) {
        switch (negotiationType) {
            case PLAINTEXT:
                return io.grpc.netty.NegotiationType.PLAINTEXT;
            case PLAINTEXT_UPGRADE:
                return io.grpc.netty.NegotiationType.PLAINTEXT_UPGRADE;
            case TLS:
                return io.grpc.netty.NegotiationType.TLS;
            default:
                throw new IllegalArgumentException("Unsupported NegotiationType: " + negotiationType);
        }
    }
572631
private void addAgent(AsteriskAgentImpl agent)
    {
        synchronized (agents)
        {
            agents.put(agent.getAgentId(), agent);
        }
        server.fireNewAgent(agent);
    }
338231
public static StandardUserAgentClient newInstance(Settings settings)
    {
        UDPConnector.Factory udpFactory = Factories.newInstance(settings, UDP_CONNECTOR_FACTORY_KEY);
        TCPConnector.Factory tcpFactory = Factories.newInstance(settings, TCP_CONNECTOR_FACTORY_KEY);
        return new StandardUserAgentClient(udpFactory.newUDPConnector(settings), tcpFactory.newTCPConnector(settings), settings);
    }
1124403
def actually_start_agent(self, descriptor, **kwargs):
        
        factory = IAgentFactory(
            applications.lookup_agent(descriptor.type_name))
        if factory.standalone:
            return self.start_standalone_agent(descriptor, factory, **kwargs)
        else:
            return self.start_agent_locally(descriptor, **kwargs)