def _calculateVectors(self):

        log.msg('* Calculating shortest-path vectors', debug=True, system=LOG_SYSTEM)
        paths = {}
        for port, vectors in self.vectors.items():

            for network, cost in vectors.items():
                if network in self.local_networks:
                    continue # skip local networks
                if network in self.blacklist_networks:
                    log.msg('Skipping network %s in vector calculation, is blacklisted' % network, system=LOG_SYSTEM)
                    continue
                if cost > self.max_cost:
                    log.msg('Skipping network %s in vector calculation, cost %i exceeds max cost %i' % (network, cost, self.max_cost), system=LOG_SYSTEM)
                    continue
                if not network in paths:
                    paths[network] = (port, cost)
                    log.msg('Added path to %s via %s. Cost %i' % (network, port, cost), debug=True, system=LOG_SYSTEM)
                elif cost < paths[network][1]:
                    paths[network] = (port, cost) # overwrite
                    log.msg((network, port, cost) % 'Updated path to %s via %s. Cost %i', debug=True, system=LOG_SYSTEM)
                # no else, it means we have a cheaper path

        self._shortest_paths = paths
dataset/ETHPy150Open NORDUnet/opennsa/opennsa/topology/linkvector.py/LinkVector._calculateVectors/swapped operands of `%`