code: def after_batch(self, stream_name: str, batch_data: Batch):
          
          for variable in self._variables:
              if variable in batch_data:
                  value = batch_data[variable]
                  if not hasattr(value, '__iter__'):
                      raise TypeError('Variable `{}` to be accumulated is not iterable.'.format(variable))
                  self._accumulator[stream_name][variable] += list(value)
              else:
                  raise KeyError('Variable `{}` to be accumulated was not found in the batch data. '
                                 'Available variables are `{}`.'.format(variable, batch_data.keys()))
docs: Extend the accumulated variables with the given batch data.
  
          :param stream_name: stream name; e.g. ``train`` or any other...
          :param batch_data: batch data = stream sources + model outputs
          :raise KeyError: if the variables to be aggregated are missing
          :raise TypeError: if the variable value is not iterable (e.g. it is only a scalar)