def migrate_node(node):
    for key, file_id in node.files_current.iteritems():
        if key not in node.files_versions:
            node.files_versions[key] = [file_id]
        else:
            if file_id not in node.files_versions[key]:
                node.files_versions[key].append(file_id)
    node.save()
Ensure that all keys present in `files_current` are also present in
dataset/ETHPy150Open CenterForOpenScience/osf.io/scripts/migrate_inconsistent_file_keys.py/migrate_node