parameters: (self, username)
docstring: This method checks if the supplied username already exists.
function: def check_username(self, username):
          '''
  
          This method checks if the supplied username already exists.
  
          '''
  
          # select dataset
          self.sql.connect(self.db_ml)
          sql_statement = 'SELECT * '\
              'FROM tbl_user '\
              'WHERE username=%s'
          args = (username)
          response = self.sql.execute('select', sql_statement, args)
  
          # retrieve any error(s)
          response_error = self.sql.get_errors()
  
          # return result
          if response_error:
              return {'error': response_error, 'result': None}
          else:
              return {'error': None, 'result': response['result']}
function_tokens: def check_username ( self , username ) : # select dataset self . sql . connect ( self . db_ml ) sql_statement = 'SELECT * ' 'FROM tbl_user ' 'WHERE username=%s' args = ( username ) response = self . sql . execute ( 'select' , sql_statement , args ) # retrieve any error(s) response_error = self . sql . get_errors ( ) # return result if response_error : return { 'error' : response_error , 'result' : None } else : return { 'error' : None , 'result' : response [ 'result' ] }