class_docstr: Dataset which reads synthetically generated anomalous images from a temporary folder.
  
  Args:
      task (str): Task type, either "classification" or "segmentation".
      transform (A.Compose): Albumentations Compose object describing the transforms that are applied to the inputs.
      source_samples (DataFrame): Normal samples to which the anomalous augmentations will be applied.
class_docstr_tok: ["Dataset","which","reads","synthetically","generated","anomalous","images","from","a","temporary","folder",".","Args",":","task","(","str",")",":","Task","type",",","either","``","classification","''","or","``","segmentation","''",".","transform","(","A.Compose",")",":","Albumentations","Compose","object","describing","the","transforms","that","are","applied","to","the","inputs",".","source_samples","(","DataFrame",")",":","Normal","samples","to","which","the","anomalous","augmentations","will","be","applied","."]
code: def __init__(
      self,
      task: TaskType,
      transform: A.Compose,
      source_samples: DataFrame,
  ) -> None:
      super().__init__(task, transform)
  
      self.source_samples = source_samples
  
      # Files will be written to a temporary directory in the workdir, which is cleaned up after code execution
      root = Path(ROOT)
      root.mkdir(parents=True, exist_ok=True)
  
      self.root = Path(mkdtemp(dir=root))
      self.im_dir = self.root / "abnormal"
      self.mask_dir = self.root / "ground_truth"
  
      # create directories
      self.im_dir.mkdir()
      self.mask_dir.mkdir()
  
      self._cleanup = True  # flag that determines if temp dir is cleaned up when instance is deleted
      self.setup()
  
imports: from __future__ import annotations
  import logging
  import math
  import shutil
  from copy import deepcopy
  from pathlib import Path
  from tempfile import mkdtemp
  import albumentations
  import cv2
  import pandas
  from albumentations.pytorch import ToTensorV2
  from pandas import DataFrame, Series
  from anomalib.data.base.dataset import AnomalibDataset
  from anomalib.data.task_type import TaskType
  from anomalib.data.utils import Augmenter, Split, read_image
label_desc: Use image node_id 1 to create a new SyntheticAnomalyDataset object from inherited base classes: AnomalibDataset with example: obj = SyntheticAnomalyDataset(task, transform, source_samples)