class_docstr: Creates an instance of a local repo from a local path.
  
  Example:
  
  ```python
  run = client.runs.submit(
      configuration=...,
      repo=LocalRepo.from_dir("."), # Mount the current folder to the run
  )
  ```
class_docstr_tok: ["Creates","an","instance","of","a","local","repo","from","a","local","path",".","Example",":","``","`","python","run","=","client.runs.submit","(","configuration=","...",",","repo=LocalRepo.from_dir","(","``",".","``",")",",","#","Mount","the","current","folder","to","the","run",")","``","`"]
code: def write_code_file(self, fp: BinaryIO) -> str:
      with tarfile.TarFile(mode="w", fileobj=fp) as t:
          t.add(
              self.run_repo_data.repo_dir,
              arcname="",
              filter=TarIgnore(
                  self.run_repo_data.repo_dir, globs=[".git"]
              ),
          )
      return get_sha256(fp)
  
imports: import tarfile
  from pathlib import Path
  from typing import BinaryIO, Optional
  from pydantic import BaseModel
  from typing_extensions import Literal
  from dstack._internal.core.models.repos.base import BaseRepoInfo, Repo
  from dstack._internal.utils.hash import get_sha256, slugify
  from dstack._internal.utils.ignore import GitIgnore
  from dstack._internal.utils.path import PathLike
label_desc: Use image node_id 3 for calling the LocalRepo obj's underlying member method code with example usage: obj.write_code_file(fp) and returns: get_sha256