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","."]
docstr: Packages local path using tar.
docstr_tok: ["Packages","local","path","using","tar","."]
code: def package(self) -> Path:
      """Packages local path using tar."""
      if self.package_path.exists():
          return self.package_path
      # create a packaging session if not available
      with self.packaging_session() as session_path:
          _tar_path(
              source_path=session_path,
              target_file=str(self.package_path),
              compression=True,
          )
      return self.package_path
  
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 7 for calling the LocalSourceCodeDir obj's underlying member method code with example usage: obj.package() and returns: self, self