code: def test_assign_records_to_groups(
      mock_shuffle,
      overlap,
      shuffle,
      expected_error,
      expected_result,
      mock_check_user,
  ):
      mock_groups = {
          "group1": ["user1", "user2"],
          "group2": ["user3", "user4"],
          "group3": ["user5"],
      }
      mock_records = [
          "record1",
          "record2",
          "record3",
          "record4",
          "record5",
          "record6",
      ]
  
      with patch(
          "argilla.client.feedback.utils.assignment.check_user",
          side_effect=mock_check_user,
      ):
          if expected_error:
              with pytest.raises(expected_error):
                  assign_records_to_groups(
                      mock_groups, mock_records, overlap, shuffle
                  )
          else:
              result = assign_records_to_groups(
                  mock_groups, mock_records, overlap, shuffle
              )
              if expected_result is not None:
                  assert result == expected_result
  
              if shuffle:
                  mock_shuffle.assert_called_once_with(mock_records)
              else:
                  mock_shuffle.assert_not_called()
  
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 7 for calling a global function with example usage: test_assign_records_to_groups(mock_shuffle, overlap, shuffle, expected_error, expected_result, mock_check_user) without return types