Gives medium class of the agent if the agency hosts it.
518995
def find_agent(self, desc):
        ''''''
        agent_id = (desc.doc_id
                    if IDocument.providedBy(desc)
                    else desc)
        self.log("I'm trying to find the agent with id: %s", agent_id)
        result = first(x for x in self._agents
                       if x._descriptor.doc_id == agent_id)
        return defer.succeed(result)
842201
function Agent(channel, info) {
  this.channel = channel
  this.info = {
    id:     channel.nextAgentID(),
    name:   info.name,
    title:  info.title
  }
  DEBUG("new Agent(" + utils.JS(this.info) + ")")
}
421256
public Agent newAgent(QualifiedName ag) {
	Agent res = of.createAgent();
	res.setId(ag);
	return res;
    }
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 };
}
204372
def AddAgency(self, name, url, timezone, agency_id=None):
    """"""
    agency = self._gtfs_factory.Agency(name, url, timezone, agency_id)
    self.AddAgencyObject(agency)
    return agency
447756
public static void createAgent (
        ClientObject target, int arg1)
    {
        sendNotification(
            target, BureauDecoder.RECEIVER_CODE, BureauDecoder.CREATE_AGENT,
            new Object[] { Integer.valueOf(arg1) });
    }
45097
@ManyToOne(targetEntity = org.openprovenance.prov.sql.QualifiedName.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "AGENT")
    public org.openprovenance.prov.model.QualifiedName getAgent() {
        return agent;
    }
1043763
def agents_me_update(self, data, **kwargs):
        ""
        api_path = "/api/v2/agents/me"
        return self.call(api_path, method="PUT", data=data, **kwargs)
608683
def get_agent(self, agent_id):
        """"""
        url = 'agents/%s' % agent_id
        return Agent(**self._api._get(url))
228524
protected synchronized void objectAvailable (AgentObject agentObject)
    {
        int oid = agentObject.getOid();

        log.info("Object " + oid + " now available");

        Agent agent;
        try {
            agent = createAgent(agentObject);
            agent.init(agentObject);
            agent.start();
        } catch (Throwable t) {
            log.warning("Could not create agent", "obj", agentObject, t);
            _bureauService.agentCreationFailed(oid);
            return;
        }

        _agents.put(oid, agent);
        _bureauService.agentCreated(oid);
    }
701145
def set_agent(self, agent):
        
        self.agent = agent
        self.queue = asyncio.Queue(loop=self.agent.loop)
        self.presence = agent.presence
        self.web = agent.web
1036517
function basic_medium(req, res, next) {

    var auth = basic_small(req);
    if (auth !== '') {
      if (check(auth, my.hash, my.file) === true) { // check if different
        return setHeader(res, 'WWW-Authenticate', my.realms) === true
          ? end_work(err, next, 401) : null;
      }

      if (my.agent === '' || my.agent === req.headers['user-agent']) { // check UA
        return end_work(err, next);
      }

      return end_work(err, next, 403);
    }

    // first attempt
    res.writeHead(401, my.realm);
    res.end();
  }
102662
def allowed(self, url, agent):
        ''''''
        return self.get(url).allowed(url, agent)
104533
def update_metadata_queue(self, agent: BaseAgent):
        
        pids = {os.getpid(), *agent.get_extra_pids()}

        helper_process_request = agent.get_helper_process_request()

        self.agent_metadata_queue.put(AgentMetadata(self.index, self.name, self.team, pids, helper_process_request))
518951
function PlanningAgent(id) {
  // execute super constructor
  eve.Agent.call(this, id);

  // connect to all transports configured by the system
  this.connect(eve.system.transports.getAll());
}
315073
def new_mapper(agent):
    """"""
    recp = recipient.Broadcast(MappingUpdatesPoster.protocol_id, 'lobby')
    return agent.initiate_protocol(MappingUpdatesPoster, recp)
817225
public boolean requestMoveTarget(int idx, long ref, float[] pos) {
        if (idx < 0 || idx >= m_maxAgents) {
            return false;
        }
        if (ref == 0) {
            return false;
        }

        CrowdAgent ag = m_agents[idx];

        // Initialize request.
        ag.setTarget(ref, pos);
        ag.targetReplan = false;

        return true;
    }