def verify_user_settings_document(document):
    try:
        assert_in('_id', document)
        assert_in('deleted', document)
        assert_in('access_token', document)
        assert_in('dropbox_id', document)
        if document['access_token']:
            assert_is_not_none(document['dropbox_id'])
        assert_in('dropbox_info', document)
        assert_in('display_name', document['dropbox_info'])
        assert_in('owner', document)
        assert_is_not_none(document['owner'])
    except __HOLE__:
        return salvage_broken_user_settings_document(document)
    else:
        return True
dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/dropbox/migrate_to_external_accounts.py/verify_user_settings_document