code: def mock_workspace_factory():
      def _factory(*args, **kwargs):
          mock = Mock(spec=Workspace)
          mock.users = []
  
          def create_mock_user(user_id):
              user_mock = Mock()
              user_mock.id = user_id
              return user_mock
  
          def add_user(user_id):
              # Check if a user with this ID already exists in the list
              if not any(user.id == user_id for user in mock.users):
                  mock_user = create_mock_user(user_id)
                  mock.users.append(mock_user)
  
          mock.add_user.side_effect = add_user
  
          return mock
  
      return _factory
  
file_path: argilla/tests/unit/client/feedback/utils/test_assignment.py
imports: import warnings
  from unittest.mock import Mock, patch
  import pytest
  from argilla.client.feedback.utils.assignment import assign_records, assign_records_to_groups, assign_records_to_individuals, assign_workspaces, check_user, check_workspace
  from argilla.client.users import User
  from argilla.client.workspaces import Workspace
label_desc: Use image node_id 4 for calling a global function with example usage: mock_workspace_factory() and returns: _factory, mock, user_mock