Return a grounded Agent based on an HGNC symbol.
16037
def get_grounded_agent(gene_name):
    """"""
    db_refs = {'TEXT': gene_name}
    if gene_name in hgnc_map:
        gene_name = hgnc_map[gene_name]
    hgnc_id = hgnc_client.get_hgnc_id(gene_name)
    if hgnc_id:
        db_refs['HGNC'] = hgnc_id
        up_id = hgnc_client.get_uniprot_id(hgnc_id)
        if up_id:
            db_refs['UP'] = up_id
    agent = Agent(gene_name, db_refs=db_refs)
    return agent
876061
public AnnotationInfo getInheritedAnnotation(Symbol sym, VisitorState state) {
    return getAnnotation(sym, markerAnnotations, state);
  }
1331013
def NewDefaultAgency(self, **kwargs):
    """"""
    agency = self._gtfs_factory.Agency(**kwargs)
    if not agency.agency_id:
      agency.agency_id = util.FindUniqueId(self._agencies)
    self._default_agency = agency
    self.SetDefaultAgency(agency, validate=False)  # Blank agency won't validate
    return agency
710782
def _get_uniprot_id(agent):
    
    up_id = agent.db_refs.get('UP')
    hgnc_id = agent.db_refs.get('HGNC')
    if up_id is None:
        if hgnc_id is None:
            # If both UniProt and HGNC refs are missing we can't
            # sequence check and so don't report a failure.
            return None
        # Try to get UniProt ID from HGNC
        up_id = hgnc_client.get_uniprot_id(hgnc_id)
        # If this fails, again, we can't sequence check
        if up_id is None:
            return None
    # If the UniProt ID is a list then choose the first one.
    if not isinstance(up_id, basestring) and \
       isinstance(up_id[0], basestring):
        up_id = up_id[0]
    return up_id
827044
def get_symbol(x):
    
    hdl = SymbolHandle()
    check_call(_LIB.MXAutogradGetSymbol(x.handle, ctypes.byref(hdl)))
    return Symbol(hdl)
1273986
def _get_controller_agent(self, arg):
        """"""
        controller_agent = None
        controller = arg.get('arg')
        # There is either a single controller here
        if controller is not None:
            controller_agent, coords = self._get_agent_from_entity(controller)
        # Or the controller is a complex
        elif arg['argument-type'] == 'complex':
            controllers = list(arg.get('args').values())
            controller_agent, coords = \
                self._get_agent_from_entity(controllers[0])
            bound_agents = [self._get_agent_from_entity(c)[0]
                            for c in controllers[1:]]
            bound_conditions = [BoundCondition(ba, True) for
                                ba in bound_agents]
            controller_agent.bound_conditions = bound_conditions
        return controller_agent, coords
643711
function agent() {
		$headers=$this->hive['HEADERS'];
		return isset($headers['X-Operamini-Phone-UA'])?
			$headers['X-Operamini-Phone-UA']:
			(isset($headers['X-Skyfire-Phone'])?
				$headers['X-Skyfire-Phone']:
				(isset($headers['User-Agent'])?
					$headers['User-Agent']:''));
	}
1205068
def get_create_base_agent(self, agent):
        
        try:
            base_agent = self.agents[agent.name]
        except KeyError:
            base_agent = BaseAgent(agent.name)
            self.agents[agent.name] = base_agent

        return base_agent
150413
def get_hgnc_name(hgnc_id):
    
    try:
        hgnc_name = hgnc_names[hgnc_id]
    except KeyError:
        xml_tree = get_hgnc_entry(hgnc_id)
        if xml_tree is None:
            return None
        hgnc_name_tag =\
            xml_tree.find("result/doc/str[@name='symbol']")
        if hgnc_name_tag is None:
            return None
        hgnc_name = hgnc_name_tag.text.strip()
    return hgnc_name
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.")
723888
def _canonical_int(self, interface):
        """"""
        if self.use_canonical_interface is True:
            return napalm.base.helpers.canonical_interface_name(
                interface, addl_name_map=None
            )
        else:
            return interface
193527
def resolve(self, spec):
    """"""
    address = Address.parse(spec)
    # NB: This is an idempotent, short-circuiting call.
    self.inject_address_closure(address)
    return self.transitive_subgraph_of_addresses([address])
229099
def create_node(self, network, participant):
        """"""
        if network.role == "practice" or network.role == "catch":
            return RogersAgentFounder(network=network, participant=participant)
        elif network.size(type=Agent) < network.generation_size:
            return RogersAgentFounder(network=network, participant=participant)
        else:
            return RogersAgent(network=network, participant=participant)
9162
def _get_hba_type(hba_type):
    '''
    
    '''
    if hba_type == "parallel":
        return vim.host.ParallelScsiHba
    elif hba_type == "block":
        return vim.host.BlockHba
    elif hba_type == "iscsi":
        return vim.host.InternetScsiHba
    elif hba_type == "fibre":
        return vim.host.FibreChannelHba

    raise ValueError('Unknown Host Bus Adapter Type')
361048
def unassign_hosting_device_from_cfg_agent(self, context, cfg_agent_id,
                                               hosting_device_id):
        """"""
        hd_db = self._get_hosting_device(context, hosting_device_id)
        if hd_db.cfg_agent_id is None and cfg_agent_id is None:
            return
        elif hd_db.cfg_agent_id != cfg_agent_id:
            LOG.debug('Hosting device %(hd_id)s is not assigned to Cisco '
                      'cfg agent %(agent_id)s',
                      {'hd_id': hosting_device_id,
                       'agent_id': cfg_agent_id})
            raise ciscocfgagentscheduler.HostingDeviceNotAssignedToCfgAgent(
                hosting_device_id=hosting_device_id, agent_id=cfg_agent_id)
        cfg_agent_db = get_agent_db_obj(self._get_agent(context, cfg_agent_id))
        cfg_notifier = self.agent_notifiers.get(c_constants.AGENT_TYPE_CFG)
        if cfg_notifier:
            cfg_notifier.hosting_devices_unassigned_from_cfg_agent(
                context, [hosting_device_id], cfg_agent_db.host)
        self._bind_hosting_device_to_cfg_agent(context, hd_db, None)
1181375
def agent(server="http://localhost:8000"):
    
    import xmlrpc.client
    sp = xmlrpc.client.ServerProxy(server)
    hw = getallhwinfo()
    fields = header_fields()
    for f in fields:
        if not f in hw:
            hw[f] = ''
    try:
        sp.puthwinfo(xmlrpc.client.dumps((hw,)))
    except xmlrpc.client.Error as v:
        print("ERROR occured: ", v)
1260199
def cli(env, identifier):
    """"""

    mgr = SoftLayer.NetworkManager(env.client)
    subnet_id = helpers.resolve_id(mgr.resolve_subnet_ids, identifier,
                                   name='subnet')

    if not (env.skip_confirmations or formatting.no_going_back(subnet_id)):
        raise exceptions.CLIAbort('Aborted')

    mgr.cancel_subnet(subnet_id)