class_docstr: Context for generating dummy shapes dataset.
  Example:
      >>> with GeneratedDummyDataset(num_train=1000,num_test=100) as dataset_path:
      >>>     some_function()
  
      Args:
          num_train (int, optional): Number of training images to generate. Defaults to 1000.
          num_test (int, optional): Number of testing images to generate per category. Defaults to 100.
          img_height (int, optional): Height of the image. Defaults to 128.
          img_width (int, optional): Width of the image. Defaults to 128.
          max_size (Optional[int], optional): Maximum size of the test shapes. Defaults to 10.
          train_shapes (List[str], optional): List of good shapes. Defaults to ["circle", "rectangle"].
          test_shapes (List[str], optional): List of anomalous shapes. Defaults to ["triangle", "ellipse"].
          seed (int, optional): Fixes seed if any number greater than 0 is provided. 0 means no seed. Defaults to 0.
class_docstr_tok: ["Context","for","generating","dummy","shapes","dataset",".","Example",":",">",">",">","with","GeneratedDummyDataset","(","num_train=1000",",","num_test=100",")","as","dataset_path",":",">",">",">","some_function","(",")","Args",":","num_train","(","int",",","optional",")",":","Number","of","training","images","to","generate",".","Defaults","to","1000.","num_test","(","int",",","optional",")",":","Number","of","testing","images","to","generate","per","category",".","Defaults","to","100.","img_height","(","int",",","optional",")",":","Height","of","the","image",".","Defaults","to","128.","img_width","(","int",",","optional",")",":","Width","of","the","image",".","Defaults","to","128.","max_size","(","Optional","[","int","]",",","optional",")",":","Maximum","size","of","the","test","shapes",".","Defaults","to","10.","train_shapes","(","List","[","str","]",",","optional",")",":","List","of","good","shapes",".","Defaults","to","[","``","circle","''",",","``","rectangle","''","]",".","test_shapes","(","List","[","str","]",",","optional",")",":","List","of","anomalous","shapes",".","Defaults","to","[","``","triangle","''",",","``","ellipse","''","]",".","seed","(","int",",","optional",")",":","Fixes","seed","if","any","number","greater","than","0","is","provided",".","0","means","no","seed",".","Defaults","to","0","."]
code: def __init__(
      self,
      num_train: int = 1000,
      num_test: int = 100,
      img_height: int = 128,
      img_width: int = 128,
      max_size: Optional[int] = 10,
      train_shapes: List[str] = ["triangle", "rectangle"],
      test_shapes: List[str] = ["star", "hexagon"],
      seed: Optional[int] = None,
  ) -> None:
      self.root_dir = mkdtemp()
      self.num_train = num_train
      self.num_test = num_test
      self.train_shapes = train_shapes
      self.test_shapes = test_shapes
      self.image_height = img_height
      self.image_width = img_width
      self.max_size = max_size
      self.seed = seed
  
imports: import os
  import shutil
  from contextlib import ContextDecorator
  from functools import wraps
  from pathlib import Path
  from tempfile import mkdtemp
  from typing import Dict, List, Optional, Union
  import numpy
  from skimage.io import imsave
  from .shapes import random_shapes
label_desc: Use image node_id 1 to create a new GeneratedDummyDataset object from inherited base classes: ContextDecorator with example: obj = GeneratedDummyDataset(num_train, num_test, img_height, img_width, max_size, train_shapes, test_shapes, seed)