original_docstring: 
          Initialize connection to REST server.
          
docstring: Initialize connection to REST server.
docstring_tokens: Initialize connection to REST server .
code: def connect(
          self,
          key: str,
          secret: str,
          session_number: int,
          server: str,
          proxy_host: str,
          proxy_port: int,
      ):
          """
          Initialize connection to REST server.
          """
          self.key = key
          self.secret = secret.encode()
  
          self.connect_time = (
              int(datetime.now().strftime("%y%m%d%H%M%S")) * self.order_count
          )
  
          if server == "REAL":
              self.init(REST_HOST, proxy_host, proxy_port)
          else:
              self.init(TESTNET_REST_HOST, proxy_host, proxy_port)
  
          self.start(session_number)
  
          self.gateway.write_log("REST API启动成功")
code_tokens: def connect ( self , key : str , secret : str , session_number : int , server : str , proxy_host : str , proxy_port : int , ) : self . key = key self . secret = secret . encode ( ) self . connect_time = ( int ( datetime . now ( ) . strftime ( "%y%m%d%H%M%S" ) ) * self . order_count ) if server == "REAL" : self . init ( REST_HOST , proxy_host , proxy_port ) else : self . init ( TESTNET_REST_HOST , proxy_host , proxy_port ) self . start ( session_number ) self . gateway . write_log ( "REST API启动成功") 
short_docstring: Initialize connection to REST server.
short_docstring_tokens: Initialize connection to REST server .
comment: """
          Initialize connection to REST server.
          """