code: def makedirs_if_not_exist(dir_path):
      """
      ensure that target directory exists, can't use exist_ok flag because it is unavailable in
      python 2.7
      """
      try:
          os.makedirs(dir_path)
      except OSError as e:
          if e.errno != errno.EEXIST:
              raise
  
imports: import argparse
  import distutils.dir_util
  import errno
  import os
  import shutil
label_desc: Use image node_id 1 for calling a global function with example usage: makedirs_if_not_exist(dir_path) without return types