class_docstr: Modified tests from dopamine run_experiment_test.py.
class_docstr_tok: ["Modified","tests","from","dopamine","run_experiment_test.py","."]
code: def prepare_mock_agent(self, batch_size):
      assert (
          batch_size % 2 == 0
      ), "Some of tests assume that batch_size % 2 == 0"
      self.batch_size = batch_size
      self._agent = mock.Mock()
      self._agent.begin_episode.side_effect = lambda x: np.repeat(
          0, self.batch_size
      )
      self._agent.step.side_effect = self._agent_step
      self._create_agent_fn = lambda x, y, summary_writer: self._agent
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import shutil
  from absl import flags
  from dopamine.discrete_domains import logger
  import mock
  import numpy
  from tensor2tensor.rl import dopamine_connector
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the BatchedRunnerTest obj's underlying member method code with example usage: obj.prepare_mock_agent(batch_size) without return types