def safe_mkdir(directory, clean=False):
  if clean:
    safe_rmtree(directory)
  try:
    os.makedirs(directory)
  except OSError as e:
    if e.errno != errno.EEXIST:
      raise
Safely create a directory.
dataset/ETHPy150Open pantsbuild/pex/pex/common.py/safe_mkdir