code: def init_output_dir(output_dir, force_overwrite):
      """Create output directory (and all intermediate dirs on the path) if it doesn't exist.
  
      Args:
          output_dir (str): output directory path.
          force_overwrite (bool): If False and output dir is complete, raise RuntimeError.
  
      Raises:
          RuntimeError if overwrite option is not enabled and output dir contains "DONE" signal file.
  
      """
      if not force_overwrite and is_done(output_dir):
          raise RuntimeError(
              f"'{output_dir}' run is already done, and not forcing overwrite"
          )
      os.makedirs(output_dir, exist_ok=True)
  
imports: import json
  import numpy
  import os
  import random
  import time
  import torch
  from dataclasses import dataclass
  from typing import Any
  import jiant.utils.python.io
  import jiant.utils.zlog
label_desc: Use image node_id 5 for calling a global function with example usage: init_output_dir(output_dir, force_overwrite) without return types