def exists_code(self, code):
        """Checks if a given code exists on the database or not"""

        try:
            self.db.codes(self.db.codes.code_id == code).select().first() != None
        except __HOLE__:
            self.create_tables()
            return False
dataset/ETHPy150Open joaoqalves/web2py-oauth2/modules/oauth/storage/__init__.py/web2pyStorage.exists_code