def migrate_status(records):
    for record in records:
        if 0 > len(record.reports):
            record.spam_status = Comment.FLAGGED
        else:
            record.spam_status = Comment.UNKNOWN
        record.save()
        logger.info('Migrated spam_status for comment {}'.format(record._id))
dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/migrate_spam.py/migrate_status/swapped operands of `>`