Gets an interconnect port.

        Args:
            id_or_uri: Can be either the interconnect id or uri.
            port_id_or_uri: The interconnect port id or uri.

        Returns:
            dict: The interconnect port.
493154
def get_port(self, id_or_uri, port_id_or_uri):
        
        uri = self._client.build_subresource_uri(id_or_uri, port_id_or_uri, "ports")
        return self._client.get(uri)
740883
def generate(self, id_or_uri):
        
        uri = self._client.build_uri(id_or_uri) + "/generate"
        return self._client.get(uri)
260554
def get_connections(self, id, connection_name, **args):
        """"""
        return self.request(
            "{0}/{1}/{2}".format(self.version, id, connection_name), args
        )
1068336
async def open_interface(self, conn_id, interface):
        

        adapter_id = self._get_property(conn_id, 'adapter')
        await self.adapters[adapter_id].open_interface(conn_id, interface)
1189456
def _connection(self):
        
        if self._pipelined_connection is not None:
            if self._pipelined_connection.share_in_threads or \
                    threading.current_thread().ident == self._pipelined_connection.current_thread_id:
                return self._pipelined_connection


        return self._direct_connection
447863
def get_or_connect(cls, **kwargs):
        
        try:
            inst = cls.get(**kwargs)
            created = False
        except DoesNotExist:
            inst = cls(**kwargs)
            created = True
        except Exception:
            raise
        return inst, created
721101
def connect_or_create(self, overwrite=False):
        
        connection = self._get_connection()
        if connection:
            return connection
        else:
            return self.create(overwrite=overwrite)
302113
def get_port_at(self, tile_id, direction):
        
        for port in self.ports:
            if port.tile_id == tile_id and port.direction == direction:
                return port
        port = Port(tile_id, direction, PortType.none)
        self.ports.append(port)
        return port
1181316
public static int getPort(String uriString) {
        try {
            return (new URI(uriString)).getPort();
        }
        catch (URISyntaxException e) {
            try {
                return (new NetworkInterfaceURI(uriString)).getPort();
            }
            catch (IllegalArgumentException ne) {
                throw new IllegalArgumentException(ne.getMessage(), ne);
            }
        }
    }
267012
def _connected(self, link_uri):
        
        print('Connected to %s' % link_uri)

        mems = self._cf.mem.get_mems(MemoryElement.TYPE_1W)
        self._mems_to_update = len(mems)
        print('Found {} 1-wire memories'.format(len(mems)))
        for m in mems:
            print('Updating id={}'.format(m.id))
            m.update(self._data_updated)
42760
def get_remote_port_id_local(self, tlv_data):
        
        ret, parsed_val = self._check_common_tlv_format(
            tlv_data, "Local:", "Port ID TLV")
        if not ret:
            return None
        local = parsed_val[1].split('\n')
        return local[0].strip()
1009082
def get_backup(self, id_or_uri):
        
        uri = self.BACKUPS_PATH + '/' + extract_id_from_uri(id_or_uri)
        return self._client.get(id_or_uri=uri)
63863
def get(cls, resource_id):
        
        res = Resource.get(resource_id)
        return cls(res) if res else None
1090578
def port_id_from_name(port_name, device_id, nodes):
        
        port_id = None
        for node in nodes:
            if device_id == node['id']:
                for port in node['ports']:
                    if port_name == port['name']:
                        port_id = port['id']
                        break
                break
        return port_id
1151490
async def open_interface(self, conn_id, interface):
        

        self._ensure_connection(conn_id, True)
        connection_string = self._get_property(conn_id, "connection_string")

        msg = dict(interface=interface, connection_string=connection_string)
        await self._send_command(OPERATIONS.OPEN_INTERFACE, msg, COMMANDS.OpenInterfaceResponse)
1075173
def get_port_name_from_id(node_id, port_id, nodes):
        
        port_name = ''
        for node in nodes:
            if node['id'] == node_id:
                for port in node['ports']:
                    if port['id'] == port_id:
                        port_name = port['name']
                        break
        return port_name
81067
def get(self, uri):
        '''
        '''
        if uri.startswith('cid:'):
            # Content-ID, so raise exception if not found.
            head, part = self.id_dict[uri[4:]]
            return StringIO.StringIO(part.getvalue())
        if self.loc_dict.has_key(uri):
            head, part = self.loc_dict[uri]
            return StringIO.StringIO(part.getvalue())
        return None