class_docstr: Container abstracting a list of callbacks.
class_docstr_tok: ["Container","abstracting","a","list","of","callbacks","."]
docstr: Helper function for all batch_{begin | end} methods.
docstr_tok: ["Helper","function","for","all","batch_","{","begin","|","end","}","methods","."]
code: def _call_batch_hook(self, mode, hook, batch, logs=None):
      """Helper function for all batch_{begin | end} methods."""
      if not self.callbacks:
          return
      hook_name = "on_{mode}_batch_{hook}".format(mode=mode, hook=hook)
      if hook == "begin":
          self._t_enter_batch = time.time()
      if hook == "end":
          # Batch is ending, calculate batch time.
          self._delta_t_batch = time.time() - self._t_enter_batch
  
      logs = logs or {}
      t_before_callbacks = time.time()
      for callback in self.callbacks:
          batch_hook = getattr(callback, hook_name)
          batch_hook(batch, logs)
      self._delta_ts[hook_name].append(time.time() - t_before_callbacks)
  
imports: import collections
  import logging
  import time
  import typing
  import numpy
  from elegy.callbacks.sigint import SigInt, SigIntMode
  from .callback import Callback
  from .history import History
  from .progbar_logger import ProgbarLogger
label_desc: Use image node_id 8 for calling the CallbackList obj's underlying member method code with example usage: obj._call_batch_hook(mode, hook, batch, logs) without return types