Check if the given path is a workdir

        Args:
            path(str): Path to check

        Return:
            bool: True if the given path is a workdir
354075
def is_workdir(cls, path):
        
        try:
            cls(path=path).load()
        except MalformedWorkdir:
            return False

        return True
993322
def path_type(path, target):
    
    if os.path.isfile(path) and target == "file":
        return True
    elif os.path.isdir(path) and target == "directory":
        return True
    else:
        print("Error: Path given is not a {}: {}".format(target, path))
    return False
1310944
def _ensure_tree(path):
    
    try:
        os.makedirs(path)
    except OSError as e:
        if e.errno == errno.EEXIST:
            if not os.path.isdir(path):
                raise
            else:
                return False
        elif e.errno == errno.EISDIR:
            return False
        else:
            raise
    else:
        return True
787508
def work_dir(path):
    '''
    

    '''
    starting_directory = os.getcwd()
    try:
        os.chdir(path)
        yield
    finally:
        os.chdir(starting_directory)
856014
def isdir(self, relpath):
    """"""
    if self._isdir_raw(relpath):
      if not self.isignored(relpath, directory=True):
        return True

    return False
1184671
@Override
	public boolean isDirectory(String path) {

		String resourcePath = getResolver().getResourcePath(path);
		return rsBrowser.isDirectory(resourcePath);
	}
144069
def mkdir(path, recursive=True):
    
    if os.path.exists(path):
        return True
    try:
        if recursive:
            os.makedirs(path)
        else:
            os.mkdir(path)
    except OSError as error:
        log.error('mkdir: execute failed: %s (%s)' % (path, error))
        return False
    return True
200634
def create_dir(path):
    
    # https://stackoverflow.com/a/5032238
    try:
        os.makedirs(path, exist_ok=True)
    except Exception as err:
        print(err)
        return False

    if os.path.exists(path):
        return True
    else:
        return False
52199
public boolean isDirectory(String path) {

		boolean isDirectory = false;
		String realPath = getRealResourcePath(path);
		if (isFileSystemPath(path, realPath)) { // The resource has been
												// remapped to a file system
												// path
			isDirectory = new File(realPath).isDirectory();
		} else {
			isDirectory = super.isDirectory(realPath);
		}
		return isDirectory;
	}
868676
def is_prefix(cls, path):
        
        lagofile = paths.Paths(path).prefix_lagofile()
        return os.path.isfile(lagofile)
896179
def is_child(child_path, parent_path):
        
        parent_dir = os.path.join(parent_path, '')
        child_dir = os.path.join(child_path, '')
        return child_dir.startswith(parent_dir)
1283654
def path_is_inside(path, dirname):
    """"""
    path = os.path.abspath(path)
    dirname = os.path.abspath(dirname)
    while len(path) >= len(dirname):
        if path == dirname:
            return True
        newpath = os.path.dirname(path)
        if newpath == path:
            return False
        path = newpath
    return False
1222308
def is_dir(self, pathobj):
        
        try:
            stat = self.stat(pathobj)

            return stat.is_dir
        except OSError as exc:
            if exc.errno != errno.ENOENT:
                raise
            return False
364616
def ensure_path_exists(dir_path):
    
    if not os.path.exists(dir_path):
        os.makedirs(dir_path)
        return True
    return False
1219937
def is_valid_dir(path):
    '''  '''
    return os.path.exists(path) and os.path.isdir(path)
1168387
def is_directory(self, path):
        """"""
        return self._getReturnCodeCmd([self._hadoop_cmd, 'fs', '-test', '-d', self._full_hdfs_path(path)]) == 0
382156
def ensure_workdir_exists(context):
    
    ensure_context_attribute_exists(context, "workdir", None)
    if not context.workdir:
        context.workdir = os.path.abspath(WORKDIR)
    pathutil.ensure_directory_exists(context.workdir)