code: def user_model_to_user_with_creds(
      user_model: UserModel,
  ) -> UserWithCreds:
      return UserWithCreds(
          id=user_model.id,
          username=user_model.name,
          global_role=user_model.global_role,
          email=user_model.email,
          creds=UserTokenCreds(token=user_model.token),
      )
  
file_path: dstack/src/dstack/_internal/server/services/users.py
imports: import uuid
  from typing import Awaitable, Callable, List, Optional, Tuple
  from sqlalchemy import delete, select, update
  from sqlalchemy.ext.asyncio import AsyncSession
  from dstack._internal.core.errors import ResourceExistsError
  from dstack._internal.core.models.users import GlobalRole, User, UserTokenCreds, UserWithCreds
  from dstack._internal.server.models import UserModel
label_desc: Use image node_id 2 for calling a global function with example usage: user_model_to_user_with_creds(user_model) and returns: UserWithCreds