def tunnel_connection(socket, addr, server, keyfile=None, password=None, paramiko=None, timeout=<NUM_LIT>):
new_url, tunnel = open_tunnel(addr, server, keyfile=keyfile, password=password, paramiko=paramiko, timeout=timeout)<EOL>socket.connect(new_url)<EOL>return tunnel<EOL>
Connect a socket to an address via an ssh tunnel.

    This is a wrapper for socket.connect(addr), when addr is not accessible
    from the local machine.  It simply creates an ssh tunnel using the remaining args,
    and calls socket.connect('tcp://localhost:lport') where lport is the randomly
    selected local port of the tunnel.