def mkdir_p(path):
try:<EOL><INDENT>os.makedirs(path)<EOL><DEDENT>except OSError as e:<EOL><INDENT>if e.errno != errno.EEXIST or not os.path.isdir(path):<EOL><INDENT>raise<EOL><DEDENT><DEDENT>
Make directory path if it does not already exist.