code: def mkdir(dir, rm_exist=False):
      if not os.path.exists(dir):
          os.makedirs(dir)
      else:
          if rm_exist:
              shutil.rmtree(dir)
              os.makedirs(dir)
  
file_path: PaddleSeg/contrib/QualityInspector/tools/dataset/visualize_annotation.py
imports: import argparse
  import os
  import sys
  import shutil
  import cv2
  import numpy
  from PIL import Image
  from paddleseg import utils
  from paddleseg.utils import progbar, visualize
label_desc: Use image node_id 3 for calling a global function with example usage: mkdir(dir, rm_exist) without return types