'Returns the other end of a link.
Given a node or (node,port) that is part of this link, it returns
the opposite end\'s (node,port).'

def other(self, n):

    if (type(n) is tuple):
        if (self[0] == n):
            return self[1]
        assert (self[1] == n)
        return self[0]
    if (self[0][0] == n):
        return self[1]
    assert (self[1][0] == n)
    return self[0]
