def SecSocketConnection(host, username, password, port=DEFAULT_PORT):
 try:
  stream = SocketStream.from_new_secure_socket(host, port, username, password)
 except:
  raise LoginError('authentication failure')
 return Connection(Channel(stream))

def SecSocketConnection ( host , username , password , port = DEFAULT_PORT ) : try : stream = SocketStream . from_new_secure_socket ( host , port , username , password ) except : raise LoginError ( 'authentication failure' ) return Connection ( Channel ( stream ) )
shorthand for creating secure socket connections .