code: def assign_records(
      users: Union[Dict[str, List[Any]], List[Any]],
      records: List[Any],
      overlap: int,
      shuffle: bool = True,
  ) -> Union[Dict[str, List[Any]], Dict[str, Dict[str, Any]]]:
      """
      Assign records to either groups or individuals, with controlled overlap and optional shuffle.
  
      Args:
          users: Either a dictionary of groups or a list of individual user objects.
          records: A list of record objects to be assigned.
          overlap: The number of times each record is assigned to consecutive users or groups (0 for no overlap).
          shuffle: If True, the records list will be shuffled before assignment. Defaults to True.
  
      Returns:
          A dictionary where each key is a group and its value is another dictionary, which maps usernames to their respective assigned records.
          Or a dictionary where keys are usernames and values are lists of assigned records.
  
      Examples:
          >>> from argilla.client.feedback.utils import assign_records
          >>> individual_assignments = assign_records([user1, user2, user3], records, 0, False)
          >>> group_assignments = assign_records({group1: [user1, user2], group2: [user3]}, records, 1, False)
  
      """
      if isinstance(users, dict):
          return assign_records_to_groups(
              users, records, overlap, shuffle
          )
      elif isinstance(users, list):
          return assign_records_to_individuals(
              users, records, overlap, shuffle
          )
  
file_path: argilla/src/argilla/client/feedback/utils/assignment.py
imports: import random
  import warnings
  from collections import defaultdict
  from typing import Any, Dict, List, Union
  from rich.progress import Progress
  from argilla.client.users import User
  from argilla.client.workspaces import Workspace
label_desc: Use image node_id 5 for calling a global function with example usage: assign_records(users, records, overlap, shuffle) and returns: assign_records_to_groups, assign_records_to_individuals