class_docstr: a ssh-tunnel launcher for parallel and distributed computing.
class_docstr_tok: ["a","ssh-tunnel","launcher","for","parallel","and","distributed","computing","."]
code: def _connect(self, localport, remotehost, remoteport, through=None):
      options = "-q -N -L %d:%s:%d" % (
          localport,
          remotehost,
          remoteport,
      )
      command = ""
      if through:
          rhost = through
      else:
          rhost = remotehost
      self._launcher(
          host=rhost, command=command, options=options, background=True
      )  # XXX: MMM
      # options=options, background=False)
      self._launcher.launch()
      self._lport = localport
      self._rport = remoteport
      self._host = rhost
      self._pid = (
          self._launcher.pid()
      )  # FIXME: should be tunnel_pid [pid()+1]
      line = self._launcher.response()
      if line:
          if line.startswith("bind"):
              raise TunnelException("bind")
          else:
              print(line)
              raise TunnelException("failure")
      return
  
file_path: pathos/pathos/secure/tunnel.py
imports: import os
  import signal
  import random
  import string
  from pathos.secure import Pipe
label_desc: Use image node_id 6 for calling the Tunnel obj's underlying member method code with example usage: obj._connect(localport, remotehost, remoteport, through) without return types