def __init__(self):
        threading.Thread.__init__(self)
        self.setDaemon(True)
        self._stop_event = threading.Event()
        
        #
        # Services we're advertising
        #
        self._services_to_advertise = collections.deque()
        #
        # Broadcast adverts which we've received (some of which will be our own)
        #
        self._services_found = {}
        
        #
        # _Command requests are collected on one queue
        # _Command responses are added to another
        #
        self._command = None
        
        #
        # Set the socket up to broadcast datagrams over UDP
        #
        self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
        self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
        self.socket.bind(("", self.beacon_port))
        #
        # Add the raw UDP socket to a ZeroMQ socket poller so we can check whether
        # it's received anything as part of the beacon's main event loop.
        #
        self.socket_fd = self.socket.fileno()
        self.poller = zmq.Poller()
        self.poller.register(self.socket, zmq.POLLIN)

        self.rpc = sockets.context.socket(zmq.REP)
        #
        # To avoid problems when restarting a beacon not long after it's been
        # closed, force the socket to shut down regardless about 1 second after 
        # it's been closed.
        #
        _bind_with_timeout(self.rpc.bind, (self.rpc_port % "tcp://127.0.0.1:%s",))
dataset/ETHPy150Open tjguk/networkzero/networkzero/discovery.py/_Beacon.__init__/swapped operands of `%`