Check if a directory should be considered in the walk.
623
def _check_open_dir(self, fs, path, info):
        # type: (FS, Text, Info) -> bool
        
        if self.exclude_dirs is not None and fs.match(self.exclude_dirs, info.name):
            return False
        if self.filter_dirs is not None and not fs.match(self.filter_dirs, info.name):
            return False
        return self.check_open_dir(fs, path, info)
573988
def ensure_dir_exists(verify_dir):
    """"""
    if not os.path.exists(verify_dir):
        # Doesn't exist create dir
        os.makedirs(verify_dir)
    else:
        # Exists
        if not os.path.isdir(verify_dir):
            # Not a dir, raise an exception
            raise ValueError("{} is not a directory".format(verify_dir))
634416
def is_readable_dir(path):
  """"""
  return os.path.isdir(path) and os.access(path, os.R_OK) and os.access(path, os.X_OK)
303568
def ensure_dir(path):
    
    os.makedirs(os.path.abspath(os.path.dirname(path)), exist_ok=True)
396601
def make_directory_if_needed(directory_path):
    
    if os.path.exists(directory_path):
        if not os.path.isdir(directory_path):
            raise OSError("Path is not a directory:", directory_path)
    else:
        os.makedirs(directory_path)
85329
def has_directory(self, name: str):
        '''
        
        '''
        return os.path.isdir(self._path / name)
701327
def verify_directory(dir):
    """"""

    tries = 0

    while not os.path.exists(dir):
        try:
            tries += 1
            os.makedirs(dir, compat.octal("0775"))
        except:
            if tries > 5:
                raise
1161963
public static void checkValidDir(final File dir) {
        checkNotNull("dir", dir);
        if (!dir.exists()) {
            throw new IllegalArgumentException("The directory '" + dir + "' does not exist!");
        }
        if (!dir.isDirectory()) {
            throw new IllegalArgumentException("The name '" + dir + "' is not a directory!");
        }
    }
122147
def is_directory(self, path):
        '''

        '''
        node = self.get_node(path)
        if not node:
            return False
        return node.is_directory
25758
def is_path_like(obj, attr=('name', 'is_file', 'is_dir', 'iterdir')):
    """"""
    for a in attr:
        if not hasattr(obj, a):
            return False
    return True
792153
def isdir(self, path):
        
        try:
            self.remote_context.check_output(["test", "-d", path])
        except subprocess.CalledProcessError as e:
            if e.returncode == 1:
                return False
            else:
                raise
        return True
727850
function isRealDirectory(p) {
    var stats;
    try {
        stats = fs.statSync(p);
    } catch (error) {
        // Not a valid path if stat fails.
        return false;
    }
    
    return (stats.isDirectory());
}
1319371
def check_path(path, create=False):
    
    if not os.path.exists(path):
        if create:
            os.makedirs(path)
            return os.path.exists(path)
        else:
            return False

    return True
711953
def isdir(path, message):
    
    if not os.path.isdir(path):
        raise FileNotFoundError(
            errno.ENOENT,
            "{}: {}".format(message, os.strerror(errno.ENOENT)), path)
526121
def _CheckIsDirectory(self, file_entry):
    
    if definitions.FILE_ENTRY_TYPE_DIRECTORY not in self._file_entry_types:
      return False
    return file_entry.IsDirectory()
1075168
def _walk_directory(root_directory):
        

        paths = [os.path.join(root, name)
                 for root, dirs, files in os.walk(root_directory)  # noqa
                 for name in files]
        paths.sort()
        return paths
243806
def ensure_path_exists(dir_path):
    
    if not os.path.exists(dir_path):
        mkdir(dir_path)
        return True
    return False