def handle(self):  # pylint: disable=R0912
        local_sock = self.connection

        if self._local_linger_args is not None:
            # Set SO_LINGER socket options on local socket
            l_onoff, l_linger = self._local_linger_args
            local_sock.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER,
                                  struct.pack('ii', l_onoff, l_linger))

        if self._remote_addr is not None:
            # Forwarding set-up
            remote_dest_sock = remote_src_sock = socket.socket(
                family=self._remote_addr_family,
                type=self._remote_socket_type,
                proto=socket.IPPROTO_IP)
            remote_dest_sock.connect(self._remote_addr)
            _trace("%s _TCPHandler connected to remote %s",
                   datetime.utcnow(), remote_dest_sock.getpeername())
        else:
            # Echo set-up
            remote_dest_sock, remote_src_sock = socket_pair()

        try:
            local_forwarder = threading.Thread(
                target=self._forward,
                args=(local_sock, remote_dest_sock,))
            local_forwarder.setDaemon(True)
            local_forwarder.start()

            try:
                self._forward(remote_src_sock, local_sock)
            finally:
                # Wait for local forwarder thread to exit
                local_forwarder.join()
        finally:
            try:
                try:
                    _safe_shutdown_socket(remote_dest_sock,
                                          socket.SHUT_RDWR)
                finally:
                    if remote_src_sock is not remote_dest_sock:
                        _safe_shutdown_socket(remote_src_sock,
                                              socket.SHUT_RDWR)
            finally:
                remote_dest_sock.close()
                if remote_src_sock is not remote_dest_sock:
                    remote_src_sock.close()
The track's popularity in the range 0-100, 0 if undefined.
dataset/ETHPy150Open pika/pika/tests/acceptance/forward_server.py/_TCPHandler.handle--crossover with--dataset/ETHPy150Open mopidy/pyspotify/spotify/track.py/Track.popularity