code: def stage2(object_folder: Path, logger=_DEFAULT_LOGGER):
      source_path = object_folder / "kubric" / "model_watertight.obj"
      target_path = object_folder / "kubric" / "collision_geometry.obj"
      log_path = object_folder / "kubric" / "stage2_logs.txt"
      stdout_path = str(object_folder / "kubric" / "stage2_stdout.txt")
  
      if target_path.is_file():
          logger.debug(f'skipping stage2 on "{object_folder}"')
          return  # stage already completed; skipping
  
      # --- pre-condition
      if not source_path.is_file():
          logger.error(
              f'stage2 pre-condition failed, file does not exist "{source_path}"'
          )
  
      # --- body
      logger.debug(f'stage2 running on "{object_folder}"')
      # TODO: how to monitor errors? should we move to "raw" VHCD?
      command_string = (
          f"python pybullet_vhacd.py "
          f"--source_path={source_path} --target_path={target_path} "
          f"--stdout_path={stdout_path} > {log_path}"
      )
  
      retobj = subprocess.run(
          command_string,
          shell=True,
          check=True,
          stdout=subprocess.DEVNULL,
          stderr=subprocess.DEVNULL,
      )
      if retobj.returncode != 0:
          logger.error(
              f"stage2 failed with return code {retobj.returncode}"
          )
  
      # --- post-condition
      if not target_path.is_file():
          logger.error(
              f'stage2 post-condition failed, file does not exist "{target_path}"'
          )
  
imports: import argparse
  import json
  import logging
  from pathlib import Path
  import shutil
  import subprocess
  import sys
  import tarfile
  from typing import Tuple
  import trimesh
  from shapenet_synsets import CATEGORY_NAMES
  from trimesh_utils import get_object_properties
  import trimesh_utils
  from urdf_template import URDF_TEMPLATE
label_desc: Use image node_id 3 for calling a global function with example usage: stage2(object_folder, logger) without return types