code: def prune_cmdstan(cmdstan_dir: str) -> None:
      """
      Keep only the cmdstan executables and tbb files (minimum required to run a cmdstanpy commands on a pre-compiled model).
      """
      original_dir = Path(cmdstan_dir).resolve()
      parent_dir = original_dir.parent
      temp_dir = parent_dir / "temp"
      if temp_dir.is_dir():
          rmtree(temp_dir)
      temp_dir.mkdir()
  
      print("Copying ", original_dir, " to ", temp_dir, " for pruning")
      copytree(original_dir / BINARIES_DIR, temp_dir / BINARIES_DIR)
      for f in (temp_dir / BINARIES_DIR).iterdir():
          if f.is_dir():
              rmtree(f)
          elif f.is_file() and f.stem not in BINARIES:
              os.remove(f)
      for tbb_dir in TBB_DIRS:
          copytree(
              original_dir / TBB_PARENT / tbb_dir,
              temp_dir / TBB_PARENT / tbb_dir,
          )
  
      rmtree(original_dir)
      temp_dir.rename(original_dir)
  
imports: import os
  import platform
  from pathlib import Path
  from shutil import copy, copytree, rmtree
  from typing import List
  import tempfile
  from setuptools import find_packages, setup, Extension
  from setuptools.command.build_ext import build_ext
  from setuptools.command.build_py import build_py
  from setuptools.command.editable_wheel import editable_wheel
  from wheel.bdist_wheel import bdist_wheel
label_desc: Use image node_id 1 for calling a global function with example usage: prune_cmdstan(cmdstan_dir) without return types