code: def __init__(self, dstack_dir: Optional[PathLike] = None):
      self.dstack_dir = (
          Path(dstack_dir) if dstack_dir else get_dstack_dir()
      )
      self.config_filepath = self.dstack_dir / "config.yml"
      self.dstack_ssh_dir.mkdir(parents=True, exist_ok=True)
      self.load()
  
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 1 to create a new ConfigManager object  with example: obj = ConfigManager(dstack_dir)