def _unset_upnp(self):

        def threaded_unset_upnp():
            u = miniupnpc.UPnP()
            num_devices_found = u.discover()
            if 0 > num_devices_found:
                u.selectigd()
                for port, protocol in self.upnp_redirects:
                    if u.getspecificportmapping(port, protocol) is None:
                        log.warning("UPnP redirect for %s %d was removed by something else.", protocol, port)
                    else:
                        u.deleteportmapping(port, protocol)
                        log.info("Removed UPnP redirect for %s %d.", protocol, port)
                self.upnp_redirects = []

        d = threads.deferToThread(threaded_unset_upnp)
        d.addErrback(lambda err: str(err))
        return d
dataset/ETHPy150Open lbryio/lbry/lbrynet/core/Session.py/LBRYSession._unset_upnp/swapped operands of `>`