def update_wp(d, o):
    try:
        save_fields = []
        if (d.write_protect != o.write_protect):
            d.write_protect = o.write_protect
            save_fields.append('write_protect')
        if (save_fields):
            d.save(update_fields=save_fields)
    except __HOLE__,e:
        raise e
dataset/ETHPy150Open open-cloud/xos/xos/synchronizers/model_policy.py/update_wp