def _ensureDir(dir_name):
 try:
  os.makedirs(dir_name)
 except OSError as why:
  if ((why.errno != EEXIST) or (not os.path.isdir(dir_name))):
   raise

def _ensureDir ( dir_name ) : try : os . makedirs ( dir_name ) except OSError as why : if ( ( why . errno != EEXIST ) or ( not os . path . isdir ( dir_name ) ) ) : raise
create dir_name as a directory if it does not exist .