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: Includes a file from a given package to the repo.
  
  Attributes:
      package (Union[ModuleType, str]): A package to include the file from.
      path (str): The path to the file to include to the repo. Must be relative to the package directory.
docstr_tok: ["Includes","a","file","from","a","given","package","to","the","repo",".","Attributes",":","package","(","Union","[","ModuleType",",","str","]",")",":","A","package","to","include","the","file","from",".","path","(","str",")",":","The","path","to","the","file","to","include","to","the","repo",".","Must","be","relative","to","the","package","directory","."]
code: def add_file_from_package(
      self, package: Union[ModuleType, str], path: str
  ):
      """
      Includes a file from a given package to the repo.
  
      Attributes:
          package (Union[ModuleType, str]): A package to include the file from.
          path (str): The path to the file to include to the repo. Must be relative to the package directory.
      """
  
      req_file = impresources.files(package) / path
      with req_file.open("rb") as f:
          self.add_file(path, f.read())
  
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 2 for calling the VirtualRepo obj's underlying member method code with example usage: obj.add_file_from_package(package, path) without return types