code: def mkdir(dirname, overwrite=False):
      
      if op.isdir(dirname):
          if overwrite:
              shutil.rmtree(dirname)
              os.mkdir(dirname)
              logging.debug("Overwrite folder `{0}`.".format(dirname))
          else:
              return False  # Nothing is changed
      else:
          try:
              os.mkdir(dirname)
          except:
              os.makedirs(dirname)
          logging.debug("`{0}` not found. Creating new.".format(dirname))
  
      return True
docs: Wraps around os.mkdir(), but checks for existence first.