def METHOD_NAME(module):
    region = module.params["region"]
    server_id = module.params["server_id"]
    user_data = module.params["user_data"]
    changed = False
    module.params['api_url'] = SCALEWAY_LOCATION[region]["api_endpoint"]
    compute_api = Scaleway(module=module)
    user_data_list = compute_api.get(path="servers/%s/user_data" % server_id)
    if not user_data_list.ok:
        msg = 'Error during user_data fetching: %s %s' % user_data_list.status_code, user_data_list.body
        compute_api.module.fail_json(msg=msg)
    present_user_data_keys = user_data_list.json["user_data"]
    present_user_data = dict(
        (key, get_user_data(compute_api=compute_api, server_id=server_id, key=key))
        for key in present_user_data_keys
    )
    if present_user_data == user_data:
        module.exit_json(changed=changed, msg=user_data_list.json)
    # First we remove keys that are not defined in the wished user_data
    for key in present_user_data:
        if key not in user_data:
            changed = True
            if compute_api.module.check_mode:
                module.exit_json(changed=changed, msg={"status": "User-data of %s would be patched." % server_id})
            delete_user_data(compute_api=compute_api, server_id=server_id, key=key)
    # Then we patch keys that are different
    for key, value in user_data.items():
        if key not in present_user_data or user_data[key] != present_user_data[key]:
            changed = True
            if compute_api.module.check_mode:
                module.exit_json(changed=changed, msg={"status": "User-data of %s would be patched." % server_id})
            patch_user_data(compute_api=compute_api, server_id=server_id, key=key, value=value)
    module.exit_json(changed=changed, msg=user_data)