code: def subdir(working_dir, *, clean_ok=False):
      """Decorator to change to a working directory."""
  
      def decorator(func):
          @functools.wraps(func)
          def wrapper(context):
              try:
                  tput_output = subprocess.check_output(
                      ["tput", "cols"], encoding="utf-8"
                  )
                  terminal_width = int(tput_output.strip())
              except subprocess.CalledProcessError:
                  terminal_width = 80
              print("⎯" * terminal_width)
              print("📁", working_dir)
              if clean_ok and context.clean and working_dir.exists():
                  print(f"🚮 Deleting directory (--clean)...")
                  shutil.rmtree(working_dir)
  
              working_dir.mkdir(parents=True, exist_ok=True)
  
              with contextlib.chdir(working_dir):
                  return func(context, working_dir)
  
          return wrapper
  
      return decorator
  
imports: import argparse
  import contextlib
  import functools
  import os
  import pathlib
  import shutil
  import subprocess
  import sys
  import sysconfig
  import tempfile
label_desc: Use image node_id 2 for calling a global function with example usage: subdir(working_dir) and returns: decorator, wrapper, func