code: def __init__(
      self,
      generator,
      steps_per_epoch,
      batch_metrics_names,
      epoch_metrics_names,
      callback=None,
      mode=None,
  ):
      # pylint: disable=too-many-arguments
      self.generator = generator
      self.steps_per_epoch = steps_per_epoch
      self.prefix = "" if mode == "train" else f"{mode}_"
      self.batch_metrics_names = [
          self.prefix + metric_name
          for metric_name in batch_metrics_names
      ]
      self.epoch_metrics_names = [
          self.prefix + metric_name
          for metric_name in epoch_metrics_names
      ]
  
      self.on_batch_begin = lambda *_: None
      self.on_batch_end = lambda *_: None
  
      if mode == "train":
          self.on_batch_begin = callback.on_train_batch_begin
          self.on_batch_end = callback.on_train_batch_end
      elif mode == "test":
          self.on_batch_begin = callback.on_test_batch_begin
          self.on_batch_end = callback.on_test_batch_end
      elif mode == "val":
          self.on_batch_begin = callback.on_valid_batch_begin
          self.on_batch_end = callback.on_valid_batch_end
  
      self.loss = None
      self.batch_metrics = None
      self.epoch_metrics = None
  
file_path: poutyne/poutyne/framework/iterators.py
imports: import itertools
  import timeit
label_desc: Use image node_id 1 to create a new StepIterator object  with example: obj = StepIterator(generator, steps_per_epoch, batch_metrics_names, epoch_metrics_names, callback, mode)