code: def setup_logging(datadir: str):
      # see: see https://docs.python.org/3/library/multiprocessing.html#logging
      formatter = logging.Formatter(
          "[%(levelname)s/%(processName)s] %(message)s"
      )
  
      # --- sends DEBUG+ logs to file
      datadir = Path(datadir)
      logpath = datadir / "shapenet2kubric.log"
      fh = logging.FileHandler(logpath, mode="w")
      fh.setLevel(logging.DEBUG)
      fh.setFormatter(formatter)
      logger.addHandler(fh)
  
      # --- send WARNING+ logs to console
      sh = logging.StreamHandler()
      sh.setLevel(logging.WARNING)
      sh.setFormatter(formatter)
      logger.addHandler(sh)
  
      # --- inform
      logging.warning(f'logging DEBUG+ to "{logpath}"')
      logging.warning(f"logging WARNING+ to stderr")
  
imports: import argparse
  from pathlib import Path
  import multiprocessing
  import logging
  import sys
  import tqdm
  import json
  from datetime import datetime
  from shapenet_denylist import invalid_model
  from shapenet_denylist import __shapenet_set__
  from convert import stage0
  from convert import stage1
  from convert import stage2
  from convert import stage3
  from convert import stage4
  from convert import stage5
  from convert import stage6
label_desc: Use image node_id 1 for calling a global function with example usage: setup_logging(datadir) without return types