original_docstring: Look up subject id based on the ID
  
      Parameters
      ----------
      db : dict
          information about the database
      code : str
          code of the subject
  
      Returns
      -------
      int
          index of the subject
      
docstring: Look up subject id based on the ID
  Parameters
  
  db : dict
  information about the database
  code : str
  code of the subject
  
  Returns
  
  int
  index of the subject
docstring_tokens: Look up subject id based on the ID Parameters db : dict information about the database code : str code of the subject Returns int index of the subject
code: def find_subject_id(db, code):
      """Look up subject id based on the ID
  
      Parameters
      ----------
      db : dict
          information about the database
      code : str
          code of the subject
  
      Returns
      -------
      int
          index of the subject
      """
      query = QSqlQuery(db['db'])
      query.prepare('SELECT subject_id FROM subject_codes WHERE subject_codes.code = :code')
      query.bindValue(':code', code)
  
      if query.exec():
          if query.next():
              return query.value('subject_id')
          else:
              return None
  
      else:
          lg.warning(query.lastError().text())
code_tokens: def find_subject_id ( db , code ) : query = QSqlQuery ( db [ 'db' ] ) query . prepare ( 'SELECT subject_id FROM subject_codes WHERE subject_codes.code = :code' ) query . bindValue ( ':code' , code ) if query . exec ( ) : if query . next ( ) : return query . value ( 'subject_id' ) else : return None else : lg . warning ( query . lastError ( ) . text ( ) )
short_docstring: Look up subject id based on the ID
  Parameters
short_docstring_tokens: Look up subject id based on the ID Parameters
comment: """Look up subject id based on the ID
  
      Parameters
      ----------
      db : dict
          information about the database
      code : str
          code of the subject
  
      Returns
      -------
      int
          index of the subject
      """