def get_port(self, dpid, remote_dpid):
        try:
            dp = self.dpids[dpid]
        except __HOLE__:
            raise ryu_exc.PortNotFound(dpid=dpid, port=None, network_id=None)

        res = [port_no for (port_no, remote_dpid_) in dp.items()
               if remote_dpid_ == remote_dpid]
        assert len(res) <= 1
        if len(res) == 0:
            raise ryu_exc.PortNotFound(dpid=dpid, port=None, network_id=None)
        return res[0]
dataset/ETHPy150Open osrg/ryu/ryu/controller/tunnels.py/DPIDs.get_port