Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def dump(pattern=r'^.*$'):
return [r.word for r in Record.select() if re.fullmatch(pattern, r.word)]
def complete(self, text, state):
if state == 0: # new query
self.records = iter(
Record.select().where(Record.word.startswith(text)))
return next(self.records).word