class_docstr: Allows mounting a repo created programmatically.
  
  Example:
  
  ```python
  virtual_repo = VirtualRepo(repo_id="some-unique-repo-id")
  virtual_repo.add_file_from_package(package=some_package, path="requirements.txt")
  virtual_repo.add_file_from_package(package=some_package, path="train.py")
  
  run = client.runs.submit(
      configuration=...,
      repo=virtual_repo,
  )
  ```
  
  Attributes:
      repo_id: A unique identifier of the repo
class_docstr_tok: ["Allows","mounting","a","repo","created","programmatically",".","Example",":","``","`","python","virtual_repo","=","VirtualRepo","(","repo_id=","''","some-unique-repo-id","''",")","virtual_repo.add_file_from_package","(","package=some_package",",","path=","''","requirements.txt","''",")","virtual_repo.add_file_from_package","(","package=some_package",",","path=","''","train.py","''",")","run","=","client.runs.submit","(","configuration=","...",",","repo=virtual_repo",",",")","``","`","Attributes",":","repo_id",":","A","unique","identifier","of","the","repo"]
docstr: Adds a given file to the repo.
  
  Attributes:
      path (str): The path inside the repo to add the file.
      content (bytes): The contents of the file.
docstr_tok: ["Adds","a","given","file","to","the","repo",".","Attributes",":","path","(","str",")",":","The","path","inside","the","repo","to","add","the","file",".","content","(","bytes",")",":","The","contents","of","the","file","."]
code: def add_file(self, path: str, content: bytes):
      """
      Adds a given file to the repo.
  
      Attributes:
          path (str): The path inside the repo to add the file.
          content (bytes): The contents of the file.
      """
  
      self.files[resolve_relative_path(path).as_posix()] = content
  
file_path: dstack/src/dstack/_internal/core/models/repos/virtual.py
imports: import io
  import tarfile
  from importlib import resources
  from types import ModuleType
  from typing import BinaryIO, Dict, Literal, Union
  from dstack._internal.core.models.repos.base import BaseRepoInfo, Repo
  from dstack._internal.utils.hash import get_sha256
  from dstack._internal.utils.path import resolve_relative_path
label_desc: Use image node_id 3 for calling the VirtualRepo obj's underlying member method code with example usage: obj.add_file(path, content) without return types