class_docstr: ClassPowerlawSampler
  
  Batch-sampler that samples 'batch-size' images using a power law distribution
  Intended to be used on balanced dataset such as Imagenet
  
  :param world_size: total number of workers in network
  :param rank: local rank in network
  :param batch_size: number of images to load from each class
  :param powerlaw: strength of the power law (coefficient)
  :param seed: common seed across workers for subsampling classes
class_docstr_tok: ["ClassPowerlawSampler","Batch-sampler","that","samples","'batch-size","'","images","using","a","power","law","distribution","Intended","to","be","used","on","balanced","dataset","such","as","Imagenet",":","param","world_size",":","total","number","of","workers","in","network",":","param","rank",":","local","rank","in","network",":","param","batch_size",":","number","of","images","to","load","from","each","class",":","param","powerlaw",":","strength","of","the","power","law","(","coefficient",")",":","param","seed",":","common","seed","across","workers","for","subsampling","classes"]
code: def __len__(self):
      return len(self.dataset) // (self.batch_size * self.world_size)
  
imports: import contextlib
  import logging
  import queue
  from typing import Dict, List
  import numpy
  import torch
  from PIL import Image
  from torch.utils.data import Dataset
  from torch.utils.data.distributed import DistributedSampler
label_desc: Use image node_id 7 for calling the ClassPowerlawSampler obj's underlying member method code with example usage: obj.__len__() and returns: unknown