'Return True if given port does not connect to another switch'

def is_edge_port(self, dpid, port):

    for link in self.adjacency:
        if ((link.dpid1 == dpid) and (link.port1 == port)):
            return False
        if ((link.dpid2 == dpid) and (link.port2 == port)):
            return False
    return True
