def METHOD_NAME(request):
    user_id = request.matchdict["user_id"]
    parent_id = user_id
    try:
        user = request.registry.storage.get(
            parent_id=parent_id, resource_name="account", object_id=user_id
        )
    except storage_exceptions.ObjectNotFoundError:
        # Don't give information on the existence of a user id: return a generic message.
        return {"message": "A temporary reset password has been sent by mail"}
    settings = request.registry.settings
    user_email = user["id"]
    email_regexp = settings.get("account_validation.email_regexp", DEFAULT_EMAIL_REGEXP)
    compiled_email_regexp = re.compile(email_regexp)
    if not compiled_email_regexp.match(user_email):
        error_details = {
            "name": "data.id",
            "description": f"The user id should match {email_regexp}.",
        }
        raise_invalid(request, **error_details)
    reset_password = str(uuid.uuid4())
    hashed_reset_password = hash_password(reset_password)
    cache_reset_password(hashed_reset_password, user_id, request.registry)
    # Send a temporary reset password by mail.
    Emailer(request, user).send_temporary_reset_password(reset_password)
    return {"message": "A temporary reset password has been sent by mail"}