Wrapper around os.mkdir which does not raise an error if the directory exists.
329717
def safeMkdir(p, permissions = permissions755):
	''''''
	try:
		os.mkdir(p)
	except OSError:
		pass
	os.chmod(p, permissions)
441675
def ensure_dir(dirname):
  
  try:
    # Tries to create the directory
    os.makedirs(dirname)
  except OSError:
    # Check that the directory exists
    if os.path.isdir(dirname): pass
    else: raise
1109939
def ensure_dir(filename):
    """"""
    directory = os.path.dirname(filename)
    if directory and not os.path.isdir(directory):
        os.makedirs(directory)
755344
def mkdirp(kls, path, mode=0o755):
		""""""
		os.makedirs(path, mode=mode, exist_ok=True)
128330
def chdir(directory):
    
    directory = os.path.abspath(directory)
    logger.info("chdir -> %s" % directory)
    try:
        if not os.path.isdir(directory):
            logger.error(
                "chdir -> %s failed! Directory does not exist!", directory
            )
            return False
        os.chdir(directory)
        return True
    except Exception as e:
        logger.error("chdir -> %s failed! %s" % (directory, e))
        return False
570607
def _make_sure_dir_exists(self):
        
        filename = self.model_config.checkpoint_dir()
        pathlib.Path(filename).mkdir(parents=True, exist_ok=True)
550371
def ensure_directory_exists(dirname, context=None):
    
    real_dirname = dirname
    if context:
        real_dirname = realpath_with_context(dirname, context)
    if not os.path.exists(real_dirname):
        os.makedirs(real_dirname)
    assert os.path.exists(real_dirname), "ENSURE dir exists: %s" % dirname
    assert os.path.isdir(real_dirname),  "ENSURE isa dir: %s" % dirname
364616
def ensure_path_exists(dir_path):
    
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
        return True
    return False
64176
def ensure_dir(path):
    """"""
    if not (os.path.exists(path) and
            os.path.isdir(path)):
        os.mkdir(path)
535084
def ensure_dirs(filename):
    """"""
    dirname = os.path.dirname(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
8311
def ensure_directory(path):
    
    dirname = os.path.dirname(path)
    if not os.path.exists(dirname):
        os.makedirs(dirname)
226092
def mkdir_p(self, mode=0o777):
        
        with contextlib.suppress(FileExistsError):
            self.mkdir(mode)
        return self
912603
def ensure_dir(dir_path):
    
    exists = dir_exists(dir_path)
    if not exists:
        try:
            os.makedirs(dir_path)
        except(Exception,RuntimeError), e:
            raise Exception("Unable to create directory %s. Cause %s" %
                            (dir_path, e))
    return exists
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;
}
1279437
def safe_makedirs(fdir):
    
    if os.path.isdir(fdir):
        pass
        # print 'dir already exists: %s' % str(dir)
    else:
        try:
            os.makedirs(fdir)
        except WindowsError as e:
            if 'Cannot create a file when that file already exists' in e:
                log.debug('relevant dir already exists')
            else:
                raise WindowsError(e)
    return True
733000
def mkdir_p(path: str) -> None:
    
    log.debug("mkdir -p " + path)
    os.makedirs(path, exist_ok=True)
453027
def safe_mkdir(self, d):
        

        if os.path.isfile(d):
            raise FileExistsError(
                "Cannont create directory %s, a file by that name already exists." % d)

        if os.path.isdir(d):
            logger.warning("%s already exists, using existing directory.", d)
            return

        os.makedirs(d)