def article_exists(self, group_name, style, range):
        table_name = self.get_table_name(group_name)
        stmt = """
                SELECT
                    COUNT(*) AS total
                FROM
                    %s
                WHERE
                    approved='Y'""" % (table_name)
        if style == 'range':
            stmt = "%s AND id > %s" % (stmt, range[0])
            if len(range) == 2:
                stmt = "%s AND id < %s" % (stmt, range[1])
        else:
            stmt = "%s AND id = %s" % (stmt, range[0])
        self.cursor.execute(stmt)
        return self.cursor.fetchone()[0]
dataset/ETHPy150Open jpm/papercut/storage/phorum_mysql.py/Papercut_Storage.article_exists/original