code: def configure_project(
      self, name: str, url: str, token: str, default: bool
  ):
      if default:
          for project in self.config.projects:
              project.default = False
      for project in self.config.projects:
          if project.name == name:
              project.url = url
              project.token = token
              project.default = default or project.default
              return
      self.config.projects.append(
          ProjectConfig(
              name=name, url=url, token=token, default=default
          )
      )
      if len(self.config.projects) == 1:
          self.config.projects[0].default = True
  
imports: import json
  import os.path
  from pathlib import Path
  from typing import Optional
  import filelock
  import yaml
  from pydantic import ValidationError
  from rich import print
  from rich.prompt import Confirm
  from dstack._internal.cli.utils.common import colors, confirm_ask
  from dstack._internal.core.models.config import GlobalConfig, ProjectConfig, RepoConfig
  from dstack._internal.core.models.repos.base import RepoType
  from dstack._internal.utils.common import get_dstack_dir
  from dstack._internal.utils.path import PathLike
label_desc: Use image node_id 5 for calling the ConfigManager obj's underlying member method code with example usage: obj.configure_project(name, url, token, default) without return types