def calclink(self, netif, netif2):
        ''' Helper used by set_position() and update() to
            calculate distance between two interfaces and perform
            linking/unlinking. Sends link/unlink messages and updates the
            WlanNode's linked dict.
        '''
        if netif == netif2:
            return
        try:
            (x, y, z) = self._netifs[netif]    
            (x2, y2, z2) = self._netifs[netif2]
        except KeyError:
            return
        if x2 is None or y2 is None:
            return
        
        d = self.calcdistance( (x,y,z), (x2,y2,z2) )
        # ordering is important, to keep the wlan._linked dict organized
        a = min(netif, netif2)
        b = max(netif, netif2)
        try:
            self.wlan._linked_lock.acquire()
            linked = self.wlan.linked(a, b)
        except KeyError:
            return
        finally:
            self.wlan._linked_lock.release()
        if self.range > d:
            if linked:
                self.wlan.unlink(a, b)
                self.sendlinkmsg(a, b, unlink=True)
        else:
            if not linked:
                self.wlan.link(a, b)
                self.sendlinkmsg(a, b)
dataset/ETHPy150Open coreemu/core/daemon/core/mobility.py/BasicRangeModel.calclink/swapped operands of `>`