code: def check_user(user_to_check: Union[str, User]) -> User:
      """
      Helper function to check if the input is a User object. If it's a string, it attempts to retrieve the User object.
      If the User does not exist, it creates a new User with a default password and role.
  
      Args:
          user_to_check: a user object or a string that represents a username
  
      Returns:
          The User object corresponding to the input.
      """
      if isinstance(user_to_check, User):
          user = user_to_check
      else:
          try:
              user = User.from_name(user_to_check)
          except ValueError:
              user = User.create(
                  username=user_to_check,
                  first_name=user_to_check,
                  password="12345678",
                  role="annotator",
              )
              warnings.warn(
                  f"The user {user.username} was created with a default password. We recommend you to change it for security reasons.",
                  UserWarning,
              )
      return user
  
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 1 for calling a global function with example usage: check_user(user_to_check) and returns: user