def main():
    for each in OsfStorageFileVersion.find(
        Q('size', 'eq', None) &
        Q('status', 'ne', 'cached') &
        Q('location.object', 'exists', True)
    ):
        logger.info('Updating metadata for OsfStorageFileVersion {}'.format(each._id))
        if sys.argv not in 'dry':
            each.update_metadata(each.metadata)
            each.save()
dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/osfstorage/migrate_metadata.py/main/swapped operands of `not in`