def getScans(self, modifications=False, fdr=True):
if fdr:<EOL><INDENT>sql = self.base_sql+"<STR_LIT>".format(self.clvl, self.srank, self.extra)<EOL>try:<EOL><INDENT>self.cur.execute(sql)<EOL><DEDENT>except sqlite3.OperationalError:<EOL><INDENT>sql = self.base_sql+"<STR_LIT>".format(self.clvl, self.extra)<EOL>self.cur.execute(sql)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>sql = self.base_sql<EOL>self.cur.execute(sql)<EOL><DEDENT>while True:<EOL><INDENT>try:<EOL><INDENT>tup = self.cur.fetchone()<EOL><DEDENT>except:<EOL><INDENT>sys.stderr.write('<STR_LIT>'.format(traceback.format_exc()))<EOL><DEDENT>else:<EOL><INDENT>while tup is not None:<EOL><INDENT>if tup is None:<EOL><INDENT>break<EOL><DEDENT>if tup[<NUM_LIT:1>] is not None:<EOL><INDENT>scan = self.parseFullScan(tup, modifications=modifications)<EOL>scan.spectrumId = tup[<NUM_LIT:3>]<EOL>yield scan<EOL><DEDENT>try:<EOL><INDENT>tup = self.cur.fetchone()<EOL><DEDENT>except:<EOL><INDENT>sys.stderr.write('<STR_LIT>'.format(traceback.format_exc()))<EOL><DEDENT><DEDENT>if tup is None:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>yield None<EOL>
get a random scan