original_docstring: 
          executes the given gremlin script with the provided parameters
  
          :param script: the gremlin script to isolate
          :type script: str
          :param params: the parameters to execute the script with
          :type params: dictionary
          :param isolate: wraps the script in a closure so any variables set aren't persisted for the next execute call
          :type isolate: bool
          :param transaction: query will be wrapped in a transaction if set to True (default)
          :type transaction: bool
  
          :rtype: list
          
docstring: executes the given gremlin script with the provided parameters
docstring_tokens: executes the given gremlin script with the provided parameters
code: def execute(self, script, params={}, isolate=True, transaction=True):
          """
          executes the given gremlin script with the provided parameters
  
          :param script: the gremlin script to isolate
          :type script: str
          :param params: the parameters to execute the script with
          :type params: dictionary
          :param isolate: wraps the script in a closure so any variables set aren't persisted for the next execute call
          :type isolate: bool
          :param transaction: query will be wrapped in a transaction if set to True (default)
          :type transaction: bool
  
          :rtype: list
          """
          for i in range(CONNECTION_ATTEMPTS):
              try:
                  if self._in_transaction:
                      transaction = False
  
                  import traceback
  
                  self._conn.send_message(
                      messages.ScriptRequest(
                          script=script,
                          params=params,
                          session_key=self._session_key,
                          isolate=isolate,
                          in_transaction=transaction,
                      )
                  )
                  response = self._conn.get_response()
  
                  if isinstance(response, messages.ErrorResponse):
                      response.raise_exception()
                  return response.results
  
              except Exception, e:
                  self.connection_failed()
  
                  # RexProInvalidSessionException happens frequently when a session is idle for too long so not logging an error
                  log_handler = logger.info if isinstance(e, RexProInvalidSessionException) else logger.error
                  log_handler("Received an exception executing query! {}".format(e))
  
                  if i >= CONNECTION_ATTEMPTS - 1:
                      raise
                  else:
                      self.close()
                      self.open()
code_tokens: def execute ( self , script , params = { } , isolate = True , transaction = True ) : for i in range ( CONNECTION_ATTEMPTS ) : try : if self . _in_transaction : transaction = False import traceback self . _conn . send_message ( messages . ScriptRequest ( script = script , params = params , session_key = self . _session_key , isolate = isolate , in_transaction = transaction , ) ) response = self . _conn . get_response ( ) if isinstance ( response , messages . ErrorResponse ) : response . raise_exception ( ) return response . results except Exception , e : self . connection_failed ( ) log_handler = logger . info if isinstance ( e , RexProInvalidSessionException ) else logger . error log_handler ( "Received an exception executing query! {}" . format ( e ) ) if i >= CONNECTION_ATTEMPTS - 1 : raise else : self . close ( ) self . open ( )
short_docstring: executes the given gremlin script with the provided parameters
short_docstring_tokens: executes the given gremlin script with the provided parameters
comment: """
          executes the given gremlin script with the provided parameters
  
          :param script: the gremlin script to isolate
          :type script: str
          :param params: the parameters to execute the script with
          :type params: dictionary
          :param isolate: wraps the script in a closure so any variables set aren't persisted for the next execute call
          :type isolate: bool
          :param transaction: query will be wrapped in a transaction if set to True (default)
          :type transaction: bool
  
          :rtype: list
          """$SEP$# RexProInvalidSessionException happens frequently when a session is idle for too long so not logging an error