class_docstr: BatchSampler - from a MNIST-like dataset, samples batch_size according to given input distribution
  assuming multi-class labels
  adapted from https://github.com/adambielski/siamese-triplet/blob/master/datasets.py
class_docstr_tok: ["BatchSampler","-","from","a","MNIST-like","dataset",",","samples","batch_size","according","to","given","input","distribution","assuming","multi-class","labels","adapted","from","https",":","\/\/github.com\/adambielski\/siamese-triplet\/blob\/master\/datasets.py"]
code: def __len__(self):
      return self._n_batches
  
imports: import logging
  import numpy
  import torch.utils.data
  import torchvision
  from torch.utils.data.sampler import BatchSampler, RandomSampler
label_desc: Use image node_id 3 for calling the ReweightedBatchSampler obj's underlying member method code with example usage: obj.__len__() and returns: self