parameters: (self, model_type=None)
docstring: This method retrieves all stored predictions for the current user.
  
          @model_type, constrains the 'select' result to a specified model type.
              Otherwise, defaults to return results for all model types.
  
          @sql_statement, is a sql format string, and not a python string.
              Therefore, '%s' is used for argument substitution.
function: def get_all_titles(self, model_type=None):
          '''
  
          This method retrieves all stored predictions for the current user.
  
          @model_type, constrains the 'select' result to a specified model type.
              Otherwise, defaults to return results for all model types.
  
          @sql_statement, is a sql format string, and not a python string.
              Therefore, '%s' is used for argument substitution.
  
          '''
  
          # select prediction
          self.sql.connect(self.db_ml)
  
          if model_type in self.model_list:
              sql_statement = 'SELECT id_result, title, datetime_created ' \
                  'FROM tbl_prediction_results '\
                  'WHERE uid_created=%s '\
                  'AND model_type=%s'
              args = (self.uid, self.model_list.index(model_type) + 1)
              response = self.sql.execute('select', sql_statement, args)
  
          elif model_type == 'all':
              sql_statement = 'SELECT id_result, title, datetime_created '\
                  'FROM tbl_prediction_results '\
                  'WHERE uid_created=%s'
              args = (self.uid)
              response = self.sql.execute('select', sql_statement, args)
  
          # retrieve any error(s)
          response_error = self.sql.get_errors()
  
          # return result
          if response_error:
              return {
                  'status': False,
                  'error': response_error,
                  'result': None
              }
          else:
              return {
                  'status': True,
                  'error': None,
                  'result': response['result'],
              }
function_tokens: def get_all_titles ( self , model_type = None ) : # select prediction self . sql . connect ( self . db_ml ) if model_type in self . model_list : sql_statement = 'SELECT id_result, title, datetime_created ' 'FROM tbl_prediction_results ' 'WHERE uid_created=%s ' 'AND model_type=%s' args = ( self . uid , self . model_list . index ( model_type ) + 1 ) response = self . sql . execute ( 'select' , sql_statement , args ) elif model_type == 'all' : sql_statement = 'SELECT id_result, title, datetime_created ' 'FROM tbl_prediction_results ' 'WHERE uid_created=%s' args = ( self . uid ) response = self . sql . execute ( 'select' , sql_statement , args ) # retrieve any error(s) response_error = self . sql . get_errors ( ) # return result if response_error : return { 'status' : False , 'error' : response_error , 'result' : None } else : return { 'status' : True , 'error' : None , 'result' : response [ 'result' ] , }