def _mkdir(p):
isdir = os.path.isdir<EOL>stack = [os.path.abspath(p)]<EOL>while not isdir(stack[-<NUM_LIT:1>]):<EOL><INDENT>parent_dir = os.path.dirname(stack[-<NUM_LIT:1>])<EOL>stack.append(parent_dir)<EOL><DEDENT>while stack:<EOL><INDENT>p = stack.pop()<EOL>if not isdir(p):<EOL><INDENT>os.mkdir(p)<EOL><DEDENT><DEDENT>
The equivalent of 'mkdir -p' in shell.