def METHOD_NAME(user_id, username, email, active, profile_picture, roles):
    """
    Updates an existing user
    :param user_id:
    :param username:
    :param email:
    :param active:
    :param profile_picture:
    :param roles:
    :return:
    """
    strict_role_enforcement = current_app.config.get("LEMUR_STRICT_ROLE_ENFORCEMENT", False)
    if strict_role_enforcement and not any(role.name in STRICT_ENFORCEMENT_DEFAULT_ROLES for role in roles):
        return dict(message="Default role required, user needs least one of the following roles assigned: admin, "
                            "operator, read-only"), 400
    user = get(user_id)
    user.username = username
    user.email = email
    user.active = active
    user.profile_picture = profile_picture
    update_roles(user, roles)
    log_service.audit_log("update_user", username, f"Updating user with id {user_id}")
    return database.METHOD_NAME(user)