def get_unannotated_message(self):
        cursor = config.db_conn.cursor()
        # select a tweet where the tweet isn't already in the destination_table
        # http://stackoverflow.com/questions/367863/sql-find-records-from-one-table-which-dont-exist-in-another
        sql = "SELECT tweet_id, tweet_text FROM {} WHERE tweet_id NOT IN (SELECT tweet_id FROM {})".format(self.source_table, self.destination_table)
        cursor.execute(sql)
        all_rows = cursor.fetchall()
        # return a random item or None if there are no messages left
        # unannotated
        if len(all_rows) > 0:
            return random.choice(all_rows)
        else:
            return None
Return 1 not-yet-annotated message from the source_table
dataset/ETHPy150Open ianozsvald/social_media_brand_disambiguator/ner_apis/ner_api_caller.py/NERAPICaller.get_unannotated_message