Creates directory path if not already
551407
function( path, callback ) {
		var parts = ( path || '' ).split( /\//g ),
			filepath = '/';

		// Trim Left
		if ( ! parts[ 0 ].length ) {
			parts.shift();
		}

		// Trim right
		if ( parts.length && ! parts[ parts.length - 1 ].length ) {
			parts.pop();
		}

		// Handle root '/' error
		if ( ! parts.length ) {
			return callback( new Error( "No directory path found to make" ) );
		}

		// Make sure each branch is created
		async.mapSeries( parts,
			function( dir, callback ) {
				fs.stat( filepath += dir + '/', function( e, stat ) {
					if ( stat && stat.isDirectory() ) {
						callback();
					}
					else {
						fs.mkdir( filepath, callback );
					}
				});
			},
			callback
		);
	}
1036687
function createDirectories(done) {
		debug('createDirectories()');
		var paths = [ options.output ];
		function iterator(dirpath, next) { mkdirp(dirpath, '0755', next); };
		async.forEach(paths, iterator, done);
	}
174962
function createDirectory(filenames, next) {
        fs.exists(config.folder, function(exists) {
          if (!exists) {
            fs.mkdir(config.folder, function(err) {
              if (err) {
                next(err);
              } else {
                next(null, filenames);
              }
            });
          } else {
            next(null, filenames);
          }
        });
      }
231337
def create_directory(self, path=None):
        
        if path is None:
            path = self.get_path()
        if not os.path.exists(path):
            os.makedirs(path)
997472
def file_w_create_directories(filepath):
    
    dirname = os.path.dirname(filepath)

    if dirname and dirname != os.path.curdir and not os.path.isdir(dirname):
        os.makedirs(dirname)

    return open(filepath, 'w')
1305053
def createpath(path, mode, exists_ok=True):
    
    try:
        os.makedirs(path, mode)
    except OSError, e:
        if e.errno != errno.EEXIST or not exists_ok:
            raise e
496381
def create_path(path):
    
    import os
    if not os.path.exists(path):
        os.makedirs(path)
64176
def ensure_dir(path):
    """"""
    if not (os.path.exists(path) and
            os.path.isdir(path)):
        os.mkdir(path)
200634
def create_dir(path):
    
    # https://stackoverflow.com/a/5032238
    try:
        os.makedirs(path, exist_ok=True)
    except Exception as err:
        print(err)
        return False

    if os.path.exists(path):
        return True
    else:
        return False
535084
def ensure_dirs(filename):
    """"""
    dirname = os.path.dirname(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
1097332
def mkdir(path, recursive=True, **kwargs):
    """"""
    import os
    if recursive:
        os.makedirs(path, **kwargs)
    else:
        os.mkdir(path, **kwargs)
398981
def create_dirs(path):
    
    fname = os.path.basename(path)

    # if file name exists in path, skip the filename
    if fname.__contains__('.'):
        path = os.path.dirname(path)

    if not os.path.exists(path):
        os.makedirs(path)
1317300
def create_dirs(fname, is_file=False):
    
    fname = os.path.abspath(fname)
    if is_file:
        fname = os.path.dirname(fname)

    if not os.path.exists(fname):
        os.makedirs(fname)
417324
def create_directory(self, path):
        
        _complain_ifclosed(self.closed)
        return self.fs.create_directory(path)
1092172
def makedirs(path):
    """"""
    path = Path(path)

    if not path.exists():
        path.mkdir(parents=True)
415743
def create_dir(path):
    
    if os.path.exists(path):
        if not os.path.isdir(path):
            logger.error('%s is not a directory', path)
            sys.exit(1)
        else:  # ignore
            pass
    else:
        os.makedirs(path)
        logger.info('Create dir: %s', path)
1332797
def _ensure_dir_exists(path):
    """"""
    if not op.exists(path):
        os.makedirs(path)
    assert op.exists(path) and op.isdir(path)