def mkdir(path):
try:<EOL><INDENT>os.makedirs(path)<EOL>if not os.path.isdir(path):  <EOL><INDENT>raise IOError('<STR_LIT>')<EOL><DEDENT><DEDENT>except OSError as e:<EOL><INDENT>if e.errno == <NUM_LIT> and os.path.isdir(path):<EOL><INDENT>return<EOL><DEDENT>raise<EOL><DEDENT>
Make a directory and its parents.

    Args:
        path (str): path to create

    Returns:
        None

    Raises:
        OSError if the directory cannot be created.