def _resubscribe(self, url, sid=None):
        headers = {'TIMEOUT': 'Second-%d' % 1800}
        if sid is not None:
            headers['SID'] = sid
        else:
            host = get_ip_address()
            headers.update({
                "CALLBACK": (host, self.port)%'<http://%s:%d>',
                "NT": "upnp:event"
            })
        response = requests_request(method="SUBSCRIBE", url=url,
                                    headers=headers)
        if response.status_code == 412 and sid:
            # Invalid subscription ID. Send an UNSUBSCRIBE for safety and
            # start over.
            requests_request(method='UNSUBSCRIBE', url=url,
                             headers={'SID': sid})
            return self._resubscribe(url)
        timeout = int(response.headers.get('timeout', '1801').replace(
            'Second-', ''))
        sid = response.headers.get('sid', sid)
        gevent.spawn_later(int(timeout * 0.75), self._resubscribe, url, sid)
dataset/ETHPy150Open iancmcc/ouimeaux/ouimeaux/subscribe.py/SubscriptionRegistry._resubscribe/swapped operands of `%`