code: def create_output_dir(dir_path):
      if os.path.exists(dir_path):
          if os.path.isdir(dir_path):
              try:
                  shutil.rmtree(dir_path)
              except OSError:
                  raise RuntimeError(
                      "Cannot delete directory %s due to permission "
                      "error, inspect and remove manually" % dir_path
                  )
          else:
              raise RuntimeError(
                  "Cannot delete non-directory %s, inspect ",
                  "and remove manually" % dir_path,
              )
      os.makedirs(dir_path)
  
file_path: mace/mace/python/tools/encrypt_opencl_codegen.py
imports: import argparse
  import hashlib
  import os
  import shutil
  import sys
  import jinja2
label_desc: Use image node_id 2 for calling a global function with example usage: create_output_dir(dir_path) without return types