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: Prunes cache; only keeps the 10 most recent items.
docstr_tok: ["Prunes","cache",";","only","keeps","the","10","most","recent","items","."]
code: def _prune_cache(self) -> None:
      """Prunes cache; only keeps the 10 most recent items."""
      packages = sorted(
          self.cache_location.iterdir(), key=os.path.getmtime
      )
      for package in packages[10:]:
          if package.is_file():
              package.unlink()
  
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 6 for calling the LocalSourceCodeDir obj's underlying member method code with example usage: obj._prune_cache() without return types