Retrieve a replication peer by name.

    @param name: The name of the peer.
    @param peer_type: Added in v11. The type of the peer. Defaults to 'REPLICATION'.
    @return: The peer.
    @since: API v3
436227
def get_peer(self, name, peer_type="REPLICATION"):
    
    params = self._get_peer_type_param(peer_type)
    return self._get("peers/" + name, ApiCmPeer, params=params, api_version=3)
975948
def peer_retrieve_by_prefix(prefix, relation_name='cluster', delimiter='_',
                            inc_list=None, exc_list=None):
    
    inc_list = inc_list if inc_list else []
    exc_list = exc_list if exc_list else []
    peerdb_settings = peer_retrieve('-', relation_name=relation_name)
    matched = {}
    if peerdb_settings is None:
        return matched
    for k, v in peerdb_settings.items():
        full_prefix = prefix + delimiter
        if k.startswith(full_prefix):
            new_key = k.replace(full_prefix, '')
            if new_key in exc_list:
                continue
            if new_key in inc_list or len(inc_list) == 0:
                matched[new_key] = v
    return matched
461135
private Peer getPeer(HFClient client, String peerName) throws InvalidArgumentException {
        Peer peer = null;
        Node p = peers.get(peerName);
        if (p != null) {
            peer = client.newPeer(p.getName(), p.getUrl(), p.getProperties());
        }
        return peer;
    }
994220
def get_connection_by_name(self, name):
        ''''''
        with self._mutex:
            for conn in self.connections:
                if conn.name == name:
                    return conn
            return None
1324477
def show_bgp_peer(self, peer_id, **_params):
        """"""
        return self.get(self.bgp_peer_path % peer_id,
                        params=_params)
972607
def get(self, name, mask=None):
        
        mypeer = self.transport.getQ2QPeer()
        tl = self.nexus.transloads[name]
        peerz = tl.peers
        if mypeer in peerz:
            peerk = peerz[mypeer]
        else:
            # all turned on initially; we aren't going to send them anything.
            peerk = PeerKnowledge(bits.BitArray(size=len(tl.mask), default=1))
            peerz[mypeer] = peerk
        peerk.sentGet = True
        return self.callRemote(
            Get, name=name, mask=mask).addCallback(lambda r: r['size'])
1294608
def ip(self) -> Optional[str]:
        
        ips = self.ips
        if ips and len(ips) > 0:
            return ips[0]
        if self._transport:
            return cast(
                str,
                self._transport.get_extra_info("peername"),
            )
        return None
991385
public static AttributeType get(final String _name)
        throws CacheReloadException
    {
        final Cache<String, AttributeType> cache = InfinispanCache.get().<String, AttributeType>getCache(
                        AttributeType.NAMECACHE);
        if (!cache.containsKey(_name)) {
            AttributeType.getAttributeTypeFromDB(AttributeType.SQL_NAME, _name);
        }
        return cache.get(_name);
    }
349477
def resource_names(self, repo_type):
        
        try:
            names = self._resource_names[repo_type]
        except KeyError:
            names = [self.name, self.name.upper()]
        return names
1269831
def canonical_peer( self, peer ):
        
        their_host, their_port = url_to_host_port( peer )

        if their_host in ['127.0.0.1', '::1']:
            their_host = 'localhost'

        return "%s:%s" % (their_host, their_port)
633667
def require_peer(self, uuid, endpoint, public_key):
        
        return lib.zyre_require_peer(self._as_parameter_, uuid, endpoint, public_key)
499844
def _get_name_info(name_index, name_list):
    
    argval = name_index
    if (name_list is not None
        # PyPY seems to "optimize" out constant names,
        # so we need for that:
        and name_index < len(name_list)):
        argval = name_list[name_index]
        argrepr = argval
    else:
        argrepr = repr(argval)
    return argval, argrepr
216481
def get(self, hostport):
        
        assert hostport, "hostport is required"
        assert isinstance(hostport, basestring), "hostport must be a string"

        if hostport not in self._peers:
            self._add(hostport)

        return self._peers[hostport]
163945
public static lbvserver_copolicy_binding[] get(nitro_service service, String name) throws Exception{
		lbvserver_copolicy_binding obj = new lbvserver_copolicy_binding();
		obj.set_name(name);
		lbvserver_copolicy_binding response[] = (lbvserver_copolicy_binding[]) obj.get_resources(service);
		return response;
	}
187319
public static vpntrafficaction get(nitro_service service, String name) throws Exception{
		vpntrafficaction obj = new vpntrafficaction();
		obj.set_name(name);
		vpntrafficaction response = (vpntrafficaction) obj.get_resource(service);
		return response;
	}
608142
def get_pokemon_by_name(self, name):
        
        endpoint = '/pokemon/' + str(name)
        return self.make_request(self.BASE_URL + endpoint)
28574
def create_downloader_of_type(type_name):
    
    downloaders = available_downloaders()

    if type_name not in downloaders.keys():
        raise UnknownDownloaderException('Unknown downloader: %s' % (type_name,))

    return downloaders[type_name]()