def _run_server(local_addr, local_addr_family, local_socket_type,  # pylint: disable=R0913
                local_linger_args, remote_addr, remote_addr_family,
                remote_socket_type, queue):

    # NOTE: We define _ThreadedTCPServer class as a closure in order to
    # override some of its class members dynamically
    # NOTE: we add `object` to the base classes because `_ThreadedTCPServer`
    # isn't derived from `object`, which prevents `super` from working properly
    class _ThreadedTCPServer(SocketServer.ThreadingMixIn,
                             SocketServer.TCPServer,
                             object):
        """Threaded streaming server for forwarding"""

        # Override TCPServer's class members
        address_family = local_addr_family
        socket_type = local_socket_type
        allow_reuse_address = True


        def __init__(self):

            handler_class_factory = partial(
                _TCPHandler,
                local_linger_args=local_linger_args,
                remote_addr=remote_addr,
                remote_addr_family=remote_addr_family,
                remote_socket_type=remote_socket_type)

            super(_ThreadedTCPServer, self).__init__(
                local_addr,
                handler_class_factory,
                bind_and_activate=True)


    server = _ThreadedTCPServer()

    # Send server socket info back to parent process
    queue.put([server.socket.family, server.server_address])

    queue.close()

    server.serve_forever()



# NOTE: we add `object` to the base classes because `StreamRequestHandler` isn't
# derived from `object`, which prevents `super` from working properly
Returns this token as a plain string, suitable for storage.
dataset/ETHPy150Open pika/pika/tests/acceptance/forward_server.py/_run_server--crossover with--dataset/ETHPy150Open mrgaaron/LinkedIn-Client-Library/liclient/oauth2/__init__.py/Token.to_string