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

    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.
    
argilla-v1/src/argilla_v1/client/feedback/utils/assignment.py