Wrapper around mkdir -pv
    
    Returns a list of directories created
12192
def mkdirs(remote_dir, use_sudo=False):
    
    func = use_sudo and sudo or run
    result = func(' '.join(['mkdir -pv',remote_dir])).split('\n')
    #extract dir list from ["mkdir: created directory `example.com/some/dir'"]
    if result[0]: result = [dir.split(' ')[3][1:-1] for dir in result if dir]
    return result
710117
def mkdirs(filename, mode=0o777):
    """"""
    dirname = os.path.dirname(filename)
    if not dirname:
        return
    _compat.makedirs(dirname, mode=mode, exist_ok=True)
130360
function mkdirSync(dirPath) {
    // Get relative path to output
    const relativePath = dirPath.replace(`${CWD}${pathSep}`, '');
  	const dirs = relativePath.split(pathSep);
  	let currentDir = CWD;

    // Check if each dir exists, and if not, create it
    dirs.forEach(dir => {
      currentDir = path.resolve(currentDir, dir);
      if(!fs.existsSync(currentDir)) {
        fs.mkdirSync(currentDir);
      }
    });
  }
943705
function mkdir_p (path, mode, callback, position) {
    var parts = require('path').normalize(path).split(osSep);

    mode = mode || process.umask();
    position = position || 0;
  
    if (position >= parts.length) {
      return callback();
    }
  
    var directory = parts.slice(0, position + 1).join(osSep) || osSep;
    fs.stat(directory, function(err) {    
      if (err === null) {
        mkdir_p(path, mode, callback, position + 1);
      } else {
        mkdirOrig(directory, mode, function (err) {
          if (err && err.code != 'EEXIST') {
            return callback(err);
          } else {
            mkdir_p(path, mode, callback, position + 1);
          }
        });
      }
    });
  }
447773
function mkdir(dirname, options = {}) {
  if (fs.existsSync(dirname)) return;
  assert.equal(typeof dirname, 'string', 'expected dirname to be a string');
  let opts = Object.assign({ cwd: process.cwd(), fs }, options);
  let mode = opts.mode || 0o777 & ~process.umask();
  let segs = path.relative(opts.cwd, dirname).split(path.sep);
  let make = dir => !exists(dir, opts) && fs.mkdirSync(dir, mode);
  for (let i = 0; i <= segs.length; i++) {
    try {
      make((dirname = path.join(opts.cwd, ...segs.slice(0, i))));
    } catch (err) {
      handleError(dirname, opts)(err);
    }
  }
  return dirname;
}
808460
def mkdir(dirname):
    
    dir_list = []

    while not client.isdir(dirname):
        dir_list.append(dirname)
        dirname = os.path.dirname(dirname)
    while len(dir_list) > 0:
        logging.info("Creating directory: %s" % (dir_list[-1]))
        try:
            client.mkdir(dir_list.pop())
        except IOError as e:
            if e.errno == errno.EEXIST:
                pass
            else:
                raise e
987054
function getDirectoryTree(dir) {
    const items = [];
    return new Promise(function(resolve) {
        fs.walk(dir)
        .on('data', function (item) {
            items.push(item.path);
        })
        .on('end', function () {
            resolve(items);
        });
    });
}
809015
def list_dir(self):
        

        bucket = self.blob.bucket
        prefix = self.blob.name
        if not prefix.endswith('/'): prefix += '/'

        for blob in bucket.list_blobs(prefix=prefix, delimiter='/'):
            yield 'gs://{}/{}'.format(blob.bucket.name, blob.name)
257143
def _get_files_generator(src_dir, files_list):
    
    if files_list:
        for d in files_list:
            yield {
                'src': os.path.join(src_dir, d['src']),
                'dst': _get_dst_dir(d['dst']),
                'post_commands': d.get('post_commands', []),
            }
929095
def check_and_create_directories(paths):
    
    for path in paths:
        if os.path.exists(path):
            shutil.rmtree(path)
        os.mkdir(path)
755344
def mkdirp(kls, path, mode=0o755):
		""""""
		os.makedirs(path, mode=mode, exist_ok=True)
1272743
function mkdirSyncRecursive(dir, mode) {
	try {
		fs.mkdirSync(dir, mode);
	}
	catch (err) {
		if (err.code === 'ENOENT') {
			mkdirSyncRecursive(path.dirname(dir), mode);
			mkdirSyncRecursive(dir, mode);
		}
		else if (err.code === 'EEXIST') {
			return;
		}
		else {
			throw err;
		}
	}
}
404712
def mkdir(self, mode=0o777, parents=False, exist_ok=False):
        
        if self._closed:
            self._raise_closed()

        def _try_func():
            self._accessor.mkdir(self, mode)

        def _exc_func(exc):
            if not parents or self.parent == self:
                raise exc
            self.parent.mkdir(parents=True, exist_ok=True)
            self.mkdir(mode, parents=False, exist_ok=exist_ok)

        try:
            _try_except_filenotfounderror(_try_func, _exc_func)
        except OSError:
            if not exist_ok or not self.is_dir():
                raise
920878
def ListDirectoryAbsolute(directory):
  """"""
  return (os.path.join(directory, path)
          for path in tf.io.gfile.listdir(directory))
568101
function (options, iterationInfo) {
        var files;
        var modules = {};
        var result = {};

        // remember the starting directory
        try {
            files = fs.readdirSync(iterationInfo.dirName);
        } catch (e) {
            if (options.optional)
                return {};
            else
                throw new Error('Directory not found: ' + iterationInfo.dirName);
        }

        // iterate through files in the current directory
        files.forEach(function (fileName) {
            iterationInfo.dirName = iterationInfo.initialDirName + '/' + fileName + '/' + options.moduleDir;
            iterationInfo.projectDir = iterationInfo.initialDirName + '/' + fileName;
            result = _.assign(doInterations(options, iterationInfo), result);
        });

        return result;
    }
422571
def _list_dir(self):
        
        return [os.path.join(self._path, fn) for fn in os.listdir(self._path)
                if not fn.endswith(self._fs_transaction_suffix)]
410399
def list_path(root_dir):
    
    res = []
    if os.path.isdir(root_dir):
        for name in os.listdir(root_dir):
            res.append(name)
    return res