code: def test_invite_to_workspace(self, environment: "Environment"):
      with pytest.raises(UserAlreadyInvited):
          invite_to_workspace(
              username=environment.user,
              workspace=environment.workspace,
              api_token=environment.admin_token,
          )
  
      with pytest.raises(UserAlreadyInvited):
          invite_to_workspace(
              username=environment.user,
              workspace=environment.workspace,
              api_token=environment.admin_token,
              role="admin",
          )
  
      with pytest.raises(WorkspaceOrUserNotFound):
          invite_to_workspace(
              username="non-existent-user",
              workspace=environment.workspace,
              api_token=environment.admin_token,
          )
  
      with pytest.raises(WorkspaceOrUserNotFound):
          invite_to_workspace(
              username=environment.user,
              workspace="non-existent-workspace",
              api_token=environment.admin_token,
          )
  
imports: import time
  from typing import Callable, Dict, List
  import backoff
  import pytest
  from neptune import Project, init_model_version
  from neptune.internal.container_type import ContainerType
  from neptune.management import ProjectVisibility, add_project_member, add_project_service_account, clear_trash, create_project, delete_project, get_project_list, get_project_member_list, get_project_service_account_list, get_workspace_member_list, get_workspace_service_account_list, invite_to_workspace, remove_project_member, remove_project_service_account, trash_objects
  from neptune.management.exceptions import ProjectPrivacyRestrictedException, UserAlreadyInvited, UserNotExistsOrWithoutAccess, WorkspaceOrUserNotFound
  from neptune.management.internal.utils import normalize_project_name
  from neptune.metadata_containers.metadata_containers_table import Table
  from tests.e2e.base import BaseE2ETest, fake
  from tests.e2e.utils import Environment, a_project_name, initialize_container
label_desc: Use image node_id 9 for calling the TestManagement obj's underlying member method code with example usage: obj.test_invite_to_workspace(environment) without return types