def setup_ensemble_workspace(args: dict, versioned_dir: bool = True) -> Path:
        """Set up the workspace at the beginning of tiled ensemble training.

        Args:
            args (dict): Tiled ensemble config dict.
            versioned_dir (bool, optional): Whether to create a versioned directory.
                Defaults to ``True``.

        Returns:
            Path: path to new workspace root dir
        """
        model_name = args["TrainModels"]["model"]["class_path"].split(".")[-1]
        # get dataset name if present in init_args
        dataset_name = args["data"]["init_args"].get("name", None)
        if dataset_name is None:
            # if not specified, take class name
            dataset_name = args["data"]["class_path"].split(".")[-1]
        category = args["data"]["init_args"].get("category", "")
        root_dir = Path(args["default_root_dir"]) / model_name / dataset_name / category
        return create_versioned_dir(root_dir) if versioned_dir else root_dir / "latest"
Set up the workspace at the beginning of tiled ensemble training.

        Args:
            args (dict): Tiled ensemble config dict.
            versioned_dir (bool, optional): Whether to create a versioned directory.
                Defaults to ``True``.

        Returns:
            Path: path to new workspace root dir
        
src/anomalib/pipelines/tiled_ensemble/components/utils/ensemble_engine.py