Make sure the directories exist for `filename`.
505945
def ensure_dirs(filename):
    """"""
    dirname, _ = os.path.split(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
1132171
def make_dir(cls, directory_name):
        """"""
        if not os.path.exists(directory_name):
            os.makedirs(directory_name)
897216
def ensure_dir(path):
    
    dirpath = os.path.dirname(path)
    if dirpath and not os.path.exists(dirpath):
        os.makedirs(dirpath)
635712
def _ensure_filepath(filename):
        

        filepath = os.path.dirname(filename)
        if not os.path.exists(filepath):
            os.makedirs(filepath)
48767
def create_dir_unless_exists(*args):
    """"""
    path = os.path.join(*args)
    if not os.path.isdir(path):
        os.makedirs(path)
317354
def ensure_dir_does_not_exist(*args):
    """"""
    path = os.path.join(*args)
    if os.path.isdir(path):
        shutil.rmtree(path)
727962
def do_files_exist(filenames):
  """"""
  preexisting = [tf.io.gfile.exists(f) for f in filenames]
  return any(preexisting)
364616
def ensure_path_exists(dir_path):
    
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
        return True
    return False
421325
def ensure_dir_exists(f, fullpath=False):
    
    if fullpath is False:
        # Get parent directory
        d = os.path.dirname(f)
    else:
        # Create the full path
        d = f
    if not os.path.exists(d):
        os.makedirs(d)
243806
def ensure_path_exists(dir_path):
    
    if not os.path.exists(dir_path):
        mkdir(dir_path)
        return True
    return False
258434
public function ensureDirectory($dirname)
	{
		if (!empty($dirname) && !$this->exists($dirname))
		{
			$this->makeDirectory($dirname);
		}
	}
5408
def file_exists(filename):
    
    try:
        return os.path.isfile(filename)
    except (UnicodeDecodeError, UnicodeEncodeError, ValueError):
        return False
872281
def _file_exists(path, filename):
  """"""
  return os.path.isfile(os.path.join(path, filename))
1007415
def ensure_dir(path):
        
        try:
            makedirs(path)
        except OSError as e:  # pragma: no cover
            if e.errno == errno.EEXIST and isdir(path):
                return (True, 'exists')
            else:
                return (False, e)
        return (True, path)
553623
def make_dirs_if_dont_exist(path):
    
    if path[-1] not in ['/']: path += '/'
    path = os.path.dirname(path)
    if path != '':
        try: os.makedirs(path)
        except OSError: pass
258197
def is_dir_exists(dirpath):
        # type: (AnyStr) -> bool
        """"""
        if dirpath is None or not os.path.exists(dirpath) or not os.path.isdir(dirpath):
            return False
        else:
            return True
430705
def ensure_dir_exists(cls, filepath):
        
        directory = os.path.dirname(filepath)
        if directory != '' and not os.path.exists(directory):
            try:
                os.makedirs(directory)
            except OSError as e:
                if e.errno != errno.EEXIST:
                    raise