<human>:  check if a directory exists and create it if necessary
<bot>: Here is some code to check if a directory `path` exists and create it if necessary

try:
  os.makedirs(path)
except OSError:
  if (not os.path.isdir(path)):
    raise

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.