docstr: Mock the init logic for ImageNet dataset.
  
  Specifically, we replace the samples and targets with random data so that actual dataset is not
  required for testing purposes.
docstr_tok: ["Mock","the","init","logic","for","ImageNet","dataset",".","Specifically",",","we","replace","the","samples","and","targets","with","random","data","so","that","actual","dataset","is","not","required","for","testing","purposes","."]
code: def __init__(
      self,
      opts: argparse.Namespace,
      is_training: bool = False,
      is_evaluation: bool = False,
      *args,
      **kwargs,
  ) -> None:
      """Mock the init logic for ImageNet dataset.
  
      Specifically, we replace the samples and targets with random data so that actual dataset is not
      required for testing purposes.
      """
      # super() is not called here intentionally.
      self.opts = opts
      self.root = None
      self.samples = [
          ["img_path", random.randint(1, 4)]
          for _ in range(TOTAL_SAMPLES)
      ]
      self.targets = [class_id for img_path, class_id in self.samples]
      self.imgs = [img_path for img_path, class_id in self.samples]
      self.is_training = is_training
      self.is_evaluation = is_evaluation
  
imports: import argparse
  import random
  from typing import Optional
  from PIL import Image
  from data.datasets.classification.imagenet import ImageNetDataset
  from data.datasets.classification.imagenet_a import ImageNetADataset
  from data.datasets.classification.imagenet_r import ImageNetRDataset
  from data.datasets.classification.imagenet_sketch import ImageNetSketchDataset
label_desc: Use image node_id 1 to create a new MockImageNetDataset object from inherited base classes: ImageNetDataset with example: obj = MockImageNetDataset(opts, is_training, is_evaluation)