code: def project_model_to_project(project_model: ProjectModel) -> Project:
      members = []
      for m in project_model.members:
          members.append(
              Member(
                  user=users.user_model_to_user(m.user),
                  project_role=m.project_role,
              )
          )
      backends = []
      for b in project_model.backends:
          configurator = get_configurator(b.type)
          if configurator is None:
              logger.warning(
                  "Configurator for backend %s not found", b.type
              )
              continue
          config_info = configurator.get_config_info(
              model=b, include_creds=False
          )
          backend_info = BackendInfo(
              name=b.type,
              config=config_info,
          )
          backends.append(backend_info)
      return Project(
          project_id=project_model.id,
          project_name=project_model.name,
          owner=users.user_model_to_user(project_model.owner),
          backends=backends,
          members=members,
      )
  
file_path: dstack/src/dstack/_internal/server/services/projects.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 ForbiddenError, ResourceExistsError, ServerClientError
  from dstack._internal.core.models.backends import BackendInfo
  from dstack._internal.core.models.projects import Member, Project
  from dstack._internal.core.models.users import GlobalRole, ProjectRole
  from dstack._internal.server.models import MemberModel, ProjectModel, UserModel
  from dstack._internal.server.schemas.projects import MemberSetting
  from dstack._internal.server.services import users
  from dstack._internal.server.services.backends import get_configurator
  from dstack._internal.server.settings import DEFAULT_PROJECT_NAME
  from dstack._internal.server.utils.common import run_async
  from dstack._internal.utils.common import get_current_datetime
  from dstack._internal.utils.crypto import generate_rsa_key_pair_bytes
  from dstack._internal.utils.logging import get_logger
label_desc: Use image node_id 1 for calling a global function with example usage: project_model_to_project(project_model) and returns: Project