class_docstr: Represents the source code directory and provide the utilities to manage it.
class_docstr_tok: ["Represents","the","source","code","directory","and","provide","the","utilities","to","manage","it","."]
code: def __init__(
      self,
      path: Path,
      ignore_functions: Optional[List[_IGNORE_FUNCTION]] = None,
      default_ignore: bool = True,
      package_source: bool = True,
      sys_customizations_root: Optional[Path] = None,
  ) -> None:
      if "LIGHTNING_VSCODE_WORKSPACE" in os.environ:
          # Don't use home to store the tar ball. This won't play nice with symlinks
          self.cache_location: Path = Path(
              "/tmp", ".lightning", "cache", "repositories"
          )
      else:
          self.cache_location: Path = (
              Path.home() / ".lightning" / "cache" / "repositories"
          )
  
      self.path = path
      self.ignore_functions = ignore_functions
      self.package_source = package_source
      self.sys_customizations_root = sys_customizations_root
  
      # cache version
      self._version: Optional[str] = None
      self._non_ignored_files: Optional[List[str]] = None
  
      # create global cache location if it doesn't exist
      if not self.cache_location.exists():
          self.cache_location.mkdir(parents=True, exist_ok=True)
  
      # Create a default dotignore if requested and it doesn't exist
      if default_ignore and not (path / DOT_IGNORE_FILENAME).is_file():
          with open(path / DOT_IGNORE_FILENAME, "w") as f:
              f.write("venv/\n")
              if (path / "bin" / "activate").is_file() or (
                  path / "pyvenv.cfg"
              ).is_file():
                  # the user is developing inside venv
                  f.write("bin/\ninclude/\nlib/\npyvenv.cfg\n")
  
      # clean old cache entries
      self._prune_cache()
  
file_path: pytorch-lightning/src/lightning/app/source_code/local.py
imports: import os
  import uuid
  from contextlib import contextmanager
  from pathlib import Path
  from shutil import copytree, rmtree
  from typing import List, Optional
  from lightning.app.core.constants import DOT_IGNORE_FILENAME, SYS_CUSTOMIZATIONS_SYNC_PATH
  from lightning.app.source_code.copytree import _IGNORE_FUNCTION, _copytree
  from lightning.app.source_code.tar import _tar_path
  from lightning.app.source_code.uploader import FileUploader
label_desc: Use image node_id 1 to create a new LocalSourceCodeDir object  with example: obj = LocalSourceCodeDir(path, ignore_functions, default_ignore, package_source, sys_customizations_root)