def attach(self, x, y):
    if (type(x) is Switch):
        self.end1 = x.id
        x.bindPort()
    else:
        self.end1 = x.id
    if (type(y) is Switch):
        self.end2 = y.id
        y.bindPort()
    else:
        self.end2 = y.id
def attach(self, x, y):
    if (type(x) is Switch):
        self.end1 = x.id
        x.bindPort()
    else:
        self.end1 = x.id
    if (type(y) is Switch):
        self.end2 = y.id
        y.bindPort()
    else:
        self.end2 = y.id