parameters: (self)
docstring: Wait until connection is set up and return the transport and protocol
          instances.
docstring_summary: Wait until connection is set up and return the transport and protocol
          instances.
docstring_tokens: Wait until connection is set up and return the transport and protocol instances .
function: def connect(self):
          """
          Wait until connection is set up and return the transport and protocol
          instances.
          """
          if self.alive:
              self._connection_made.wait()
              if not self.alive:
                  raise RuntimeError('connection_lost already called')
              return (self, self.protocol)
          else:
              raise RuntimeError('already stopped')
function_tokens: def connect ( self ) : if self . alive : self . _connection_made . wait ( ) if not self . alive : raise RuntimeError ( 'connection_lost already called' ) return ( self , self . protocol ) else : raise RuntimeError ( 'already stopped' )