Locate a port by name.

        @param name: A port name.
        @type name: str
        @return: The port object.
        @rtype: L{Port}
348868
def port(self, name):
        
        for p in self.ports:
            if p.name == name:
                return p
253950
def get_name(self, name):
        """"""
        if name not in self.get_names():
            raise exceptions.NameNotFoundError('name %s not found' % name)
        return self.get_names()[name]
5442
def get_by_name(self, name):
        
        for p in self.project_list:
            if p.nme == name:
                return p
        return None
274328
def find(self, name):
        

        try:
            att = self.attr(name)
            if att._index is None:
                att = None
        except HDF4Error:
            att = None
        return att
940006
def findattr(self, name):
        

        try:
            att = self.attr(name)
            if att._index is None:
                att = None
        except HDF4Error:
            att = None
        return att
668398
def get_name_init(self, name):
        
        self._register_name(name)

        return self._var_name_mappers[name].get_init()
1021557
def get_port(self, adapter_number, port_number):
        
        for port in self.ports:
            if port.adapter_number == adapter_number and port.port_number == port_number:
                return port
        return None
429322
private Object get(String name) {

		Object value = find(name);
		if (value == null) {
			throw new IllegalArgumentException("Setting: '" + name + "', not found!");
		}

		return value;
	}
183797
def _parse_connection_name(self, name):
        
        if name is None:
            name = self.get_default_connection()

        if name.endswith(('::read', '::write')):
            return name.split('::', 1)

        return name, None
211097
def get_connection(self, name):
        
        return self._api_get('/api/connections/{0}'.format(
            urllib.parse.quote_plus(name)
        ))
342258
def _list_vlans_by_name(self, name):
        
        results = self.list_vlans(name=name, mask='id')
        return [result['id'] for result in results]
605395
def get_by_name(self, name):
        
        result = self.get_by("name", name)

        if result:
            data = result[0]
            new_resource = self.new(self._connection, data)
        else:
            new_resource = None

        return new_resource
891290
def get_variable(self, name):
        
        name = get_op_tensor_name(name)[1]
        if len(self.vs_name):
            name_with_vs = self.vs_name + "/" + name
        else:
            name_with_vs = name
        return get_op_or_tensor_by_name(name_with_vs)
1248225
def discover_remote(self, destination, name):
        
        assert (isinstance(destination, str))
        if destination.startswith("["):
            split = destination.split("]", 1)
            host = split[0][1:]
            port = int(split[1][1:])
        else:
            split = destination.split(":", 1)
            host = split[0]
            port = int(split[1])
        server = (host, port)
        client = HelperClient(server)
        response = client.discover()
        client.stop()
        self.discover_remote_results(response, name)
190123
public function get(string $name = '')
    {
        switch (true) {
            case ('' == $name):
                $result = $this->ports;
                break;
            case $this->has($name):
                $result = $this->ports[$name];
                break;
            default:
                throw new PortException("The port {$name} does not exist!");
        }

        return $result;
    }
281110
def hostname_with_port(self):
        ''''''
        default_port = RELATIVE_SCHEME_DEFAULT_PORTS.get(self.scheme)
        if not default_port:
            return ''

        assert '[' not in self.hostname
        assert ']' not in self.hostname

        if self.is_ipv6():
            hostname = '[{}]'.format(self.hostname)
        else:
            hostname = self.hostname

        if default_port != self.port:
            return '{}:{}'.format(hostname, self.port)
        else:
            return hostname
977743
def locate(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('locate', **{
        'name': name,
        'locator': ctx.locator,
    })