def setup_ssh_tunnel(job_id, local_port, remote_port):
    """
    Setup an ssh tunnel to the given job-id.  This will establish
    the port over the given local_port to the given remote_port
    and then exit, keeping the tunnel in place until the job is
    terminated.
    """
    cmd = ['dx', 'ssh', '--suppress-running-check', job_id, '-o', 'StrictHostKeyChecking no']
    cmd += ['-f', '-L', '{0}:localhost:{1}'.format(local_port, remote_port), '-N']
    subprocess.check_call(cmd)
def setup_ssh_tunnel ( job_id , local_port , remote_port ) : cmd = [ 'dx' , 'ssh' , '--suppress-running-check' , job_id , '-o' , 'StrictHostKeyChecking no' ] cmd += [ '-f' , '-L' , '{0}:localhost:{1}' . format ( local_port , remote_port ) , '-N' ] subprocess . check_call ( cmd )
Setup an ssh tunnel to the given job-id.  This will establish
    the port over the given local_port to the given remote_port
    and then exit, keeping the tunnel in place until the job is
    terminated.