code: def _create_folder(folder, overwrite=False):
      """Create a folder"""
      if folder[0] == "~":
          folder = os.path.expanduser(folder)
      if os.path.exists(folder):
          if not overwrite:
              logger.fatal(
                  "Folder %s exists, please remove folder or use --overwrite",
                  folder,
              )
              raise Exception(
                  "Folder {} exists, please remove folder or use --overwrite".format(
                      folder
                  )
              )
          else:
              rmtree(folder)
      try:
          os.mkdir(folder)
      except Exception as e:  # pragma: no cover
          logger.fatal(
              "Failed to create folder, check the error message below"
          )
          raise e
      return folder
  
file_path: auptimizer/src/aup/setup.py
imports: import json
  import logging
  import os
  from shutil import rmtree
  import sys
  import click
  import coloredlogs
  from six.moves import input
  from six.moves.configparser import ConfigParser
  from .utils import get_default_username, LOG_LEVEL
label_desc: Use image node_id 1 for calling a global function with example usage: _create_folder(folder, overwrite) and returns: folder