class_docstr: A helper class for automagically batching jobs.
class_docstr_tok: ["A","helper","class","for","automagically","batching","jobs","."]
docstr: Callback indicate how long it took to run a batch
code: def batch_completed(self, batch_size, duration):
      """Callback indicate how long it took to run a batch"""
      if batch_size == self._effective_batch_size:
          # Update the smoothed streaming estimate of the duration of a batch
          # from dispatch to completion
          old_duration = self._smoothed_batch_duration
          if old_duration == 0:
              # First record of duration for this batch size after the last
              # reset.
              new_duration = duration
          else:
              # Update the exponentially weighted average of the duration of
              # batch for the current effective size.
              new_duration = 0.8 * old_duration + 0.2 * duration
          self._smoothed_batch_duration = new_duration
  
imports: import gc
  import os
  import sys
  import warnings
  import threading
  from abc import ABCMeta, abstractmethod
  from .format_stack import format_exc
  from .my_exceptions import WorkerInterrupt, TransportableException
  from ._multiprocessing_helpers import mp
  from ._compat import with_metaclass
label_desc: Use image node_id 2 for calling the AutoBatchingMixin obj's underlying member method code with example usage: obj.batch_completed(batch_size, duration) without return types