def create_directory(directory_path, ensure_writability = False):
    """
    Creates a directory (with subdirs) if it doesn't exist.
    
    @param directory_path: the path of the directory and subdirectories to be created. 
    """
    if ensure_writability:
        if not os.access(os.path.dirname(directory_path), os.W_OK):
            return False
    
    try:
        os.makedirs(directory_path)
        return True
    except __HOLE__, e:
        if e.errno != errno.EEXIST:
            raise
    
    return False
dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/pyproct/tools/scriptTools.py/create_directory