code: def __next__(self):
      self.batch += 1
      if self.batch > self.nbatches:
          raise StopIteration()
      return self.datasampler()
  
imports: import os
  import ctypes
  import numpy
label_desc: Use image node_id 3 for calling the TrainDataSampler obj's underlying member method code with example usage: obj.__next__() and returns: self