#! /usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import os


def mkdir(path_to_dir):
    """Make a new directory if the directory does not exist.
    Args:
        path_to_dir (string): path to a directory
    Returns:
        path (string): path to the new directory
    """
    if path_to_dir is not None and (not os.path.isdir(path_to_dir)):
        os.mkdir(path_to_dir)
    return path_to_dir


def mkdir_join(path_to_dir, *dir_name):
    """Concatenate root path and 1 or more paths, and make a new direcory if
    the direcory does not exist.
    Args:
        path_to_dir (string): path to a diretcory
        dir_name (string): a direcory name
    Returns:
        path to the new directory
    """
    if path_to_dir is None:
        return path_to_dir
    for i in range(len(dir_name)):
        path_to_dir = mkdir(os.path.join(path_to_dir, dir_name[i]))
    return path_to_dir

@@ -161,16 +161,48 @@
 port os%0A
+from os.path import join, isdir%0A
 %0A%0Adef mk
@@ -450,24 +450,16 @@
 nd (not 
-os.path.
 isdir(pa
@@ -924,32 +924,149 @@
 name)):%0A        
+if '.' not in dir_name%5Bi%5D:%0A            path_to_dir = mkdir(join(path_to_dir, dir_name%5Bi%5D))%0A        else:%0A            
 path_to_dir = mk
@@ -1067,22 +1067,8 @@
 r = 
-mkdir(os.path.
 join
@@ -1089,25 +1089,24 @@
 dir_name%5Bi%5D)
-)
 %0A    return 

Fix bug in path