code: def test_apply_batches(self):
      def mse(y_actual, y_predicted):
          return np.mean((y_actual - y_predicted) ** 2)
  
      y_actual = np.arange(20)
      y_predicted = np.ones(20) * 10
  
      outputs = iters.apply_batches(
          function=mse,
          inputs=[y_actual, y_predicted],
          batch_size=7,
      )
      np.testing.assert_array_almost_equal(
          outputs, np.array([53, 4, 45.1666666])
      )
  
      avg_loss = iters.apply_batches(
          function=mse,
          inputs=[y_actual, y_predicted],
          batch_size=7,
          average_outputs=True,
      )
      self.assertEqual(avg_loss, mse(y_actual, y_predicted))
  
file_path: neupy/tests/utils/test_iters.py
imports: import numpy
  from neupy.utils import iters
  from neupy.utils.iters import average_batch_errors, count_samples, count_minibatches
  from base import BaseTestCase
label_desc: Use image node_id 7 for calling the ItersUtilsTestCase obj's underlying member method code with example usage: obj.test_apply_batches() and returns: np