def METHOD_NAME(self, nepochs=-1, nbatches=-1):
    """Repeat iterating through the dataset for the given #epochs up to the given #samples."""
    if nepochs > 0:
        self.repetitions = nepochs
        self.nsamples = nbatches
    else:
        self.repetitions = sys.maxsize
        self.nsamples = nbatches
    return self