Ensure the existence of the (parent) directory of f
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)
1189710
def parent_directory(self):
        """"""
        self.chdir(os.path.join(getcwd_or_home(), os.path.pardir))
748617
def assure_directory_exists(path, is_file=False):
    """"""
    if is_file:
        path = osp.dirname(path)
    # END handle file
    if not osp.isdir(path):
        os.makedirs(path)
        return True
    return False
340788
def ensure_parent (self, mode=0o777, parents=False):
        
        return self.parent.ensure_dir (mode, parents)
1214659
def DirContains(self,f) :
        
        def match(fsNode) :
            if not fsNode.isdir() : return False 
            for c in fsNode.children() :
                if f(c) : return True
            return False
        return self.make_return(match)
2705
function existDir(getDir) {
        fs.exists(getDir, (exists) => {
            if (exists) {
                existDir(`${dir}/${getVersion()}`);
            } else {
                callBack(_baseVersion.join('.'));
            }
        });
    }
1303129
def parent_dir(path):
    ''''''
    return os.path.abspath(os.path.join(path, os.pardir, os.pardir, '_build'))
535084
def ensure_dirs(filename):
    """"""
    dirname = os.path.dirname(filename)
    if dirname and not os.path.exists(dirname):
        os.makedirs(dirname)
364616
def ensure_path_exists(dir_path):
    
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
        return True
    return False
145725
def safe_rmtree(directory):
  """"""
  if os.path.exists(directory):
    shutil.rmtree(directory, True)
1195311
def exists(self, relpath):
    """"""
    if self.isignored(self._append_slash_if_dir_path(relpath)):
      return False
    return self._exists_raw(relpath)
2575
public static void ensureParentDirectoryExists(File f) throws IOException {
    final File parent = f.getParentFile();
    if (parent != null) {
      java.nio.file.Files.createDirectories(parent.toPath());
    }
  }
1230217
def mkdir(self, path, parents=True, raise_if_exists=False):
        
        try:
            self.call_check(load_hadoop_cmd() + ['fs', '-mkdir', path])
        except hdfs_error.HDFSCliError as ex:
            if "File exists" in ex.stderr:
                if raise_if_exists:
                    raise FileAlreadyExists(ex.stderr)
            else:
                raise
1215922
def fetch_parent_dir(filepath, n=1):
    '''
    '''
    filepath = os.path.realpath(filepath)
    for i in range(n):
        filepath = os.path.dirname(filepath)
    return os.path.basename(filepath)
961902
def ensure_exists(self):
        """"""
        if not self.context.is_directory(self.directory):
            # This can also happen when we don't have permission to one of the
            # parent directories so we'll point that out in the error message
            # when it seems applicable (so as not to confuse users).
            if self.context.have_superuser_privileges:
                msg = "The directory %s doesn't exist!"
                raise ValueError(msg % self)
            else:
                raise ValueError(compact("""
                    The directory {location} isn't accessible, most likely
                    because it doesn't exist or because of permissions. If
                    you're sure the directory exists you can use the
                    --use-sudo option.
                """, location=self))
325520
def make_file_exist(self):
        """"""
        self.parent.make_directory_exist()
        self.parent.touch_file(self.name)
        return self
969757
def ensure_directory
      dir = File.dirname(full_filename)
      unless File.directory?(dir)
        FileUtils.mkdir_p(dir)
      end
    end