class_docstr: Dataset used for testing. Wraps a real dataset with a
  batchsize_per_replica, but allows us to delete samples on return
  to simulate errors (similar to what happens with Everstore)
class_docstr_tok: ["Dataset","used","for","testing",".","Wraps","a","real","dataset","with","a","batchsize_per_replica",",","but","allows","us","to","delete","samples","on","return","to","simulate","errors","(","similar","to","what","happens","with","Everstore",")"]
code: def __getitem__(self, idx):
      batch = self.dataset[idx]
      # If rebatch map contains index, resize the batch
      if idx in self.rebatch_map:
          num_samples = self.rebatch_map[idx]
          if num_samples < batch["input"].size()[0]:
              batch["input"] = batch["input"][:num_samples]
              batch["target"] = batch["target"][:num_samples]
  
      return batch
  
imports: import os
  import unittest
  from functools import wraps
  import torch
  from classy_vision.hooks import ClassyHook
  from classy_vision.tasks import ClassyTask
  from classy_vision.trainer import ClassyTrainer
label_desc: Use image node_id 2 for calling the MockErrorDataset obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: batch