human
check if a directory exists and create it if necessary
assistant
Here is some code to check if a directory `path` exists and create it if necessary

try:
    os.makedirs(path)
except OSError as exception:
    if (exception.errno != errno.EEXIST):
        raise

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