code: def test_userservice_exchange_credentials_get_email_fails(
      monkeypatch: MonkeyPatch,
      user_service: UserService,
      unauthed_context: UnauthedServiceContext,
      guest_user: User,
  ) -> None:
      get_by_email_error = "Failed to connect to server."
  
      def mock_get_by_email(
          credentials: SyftVerifyKey, email: str
      ) -> Err:
          return Err(get_by_email_error)
  
      monkeypatch.setattr(
          user_service.stash, "get_by_email", mock_get_by_email
      )
      expected_error_msg = f"Failed to retrieve user with {guest_user.email} with error: {get_by_email_error}"
  
      response = user_service.exchange_credentials(unauthed_context)
      assert isinstance(response, SyftError)
      assert response.message == expected_error_msg
  
imports: from typing import List
  from typing import Tuple
  from typing import Type
  from typing import Union
  from unittest import mock
  from faker import Faker
  from pytest import MonkeyPatch
  from result import Err
  from result import Ok
  from syft.node.credentials import SyftVerifyKey
  from syft.node.worker import Worker
  from syft.service.context import AuthedServiceContext
  from syft.service.context import NodeServiceContext
  from syft.service.context import UnauthedServiceContext
  from syft.service.response import SyftError
  from syft.service.response import SyftSuccess
  from syft.service.user.user import User
  from syft.service.user.user import UserCreate
  from syft.service.user.user import UserPrivateKey
  from syft.service.user.user import UserUpdate
  from syft.service.user.user import UserView
  from syft.service.user.user_roles import ServiceRole
  from syft.service.user.user_service import UserService
  from syft.types.uid import UID
label_desc: Use image node_id 29 for calling a global function with example usage: test_userservice_exchange_credentials_get_email_fails(monkeypatch, user_service, unauthed_context, guest_user) and returns: Err