code: def _test_abc(
      self,
      t_max,
      recurrent,
      discrete=True,
      episodic=True,
      steps=100000,
      require_success=True,
  ):
      nproc = 8
  
      def make_env(process_idx, test):
          size = 2
          return ABC(
              size=size,
              discrete=discrete,
              episodic=episodic or test,
              partially_observable=self.recurrent,
              deterministic=test,
          )
  
      env = make_env(0, False)
  
      model = self.make_model(env)
  
      from pfrl.optimizers import SharedRMSpropEpsInsideSqrt
  
      opt = SharedRMSpropEpsInsideSqrt(model.parameters())
      gamma = 0.8
      beta = 1e-2
      agent = a3c.A3C(
          model,
          opt,
          t_max=t_max,
          gamma=gamma,
          beta=beta,
          act_deterministically=True,
          max_grad_norm=1.0,
          recurrent=recurrent,
      )
  
      max_episode_len = None if episodic else 2
  
      with warnings.catch_warnings(record=True) as warns:
          train_agent_async(
              outdir=self.outdir,
              processes=nproc,
              make_env=make_env,
              agent=agent,
              steps=steps,
              max_episode_len=max_episode_len,
              eval_interval=500,
              eval_n_steps=None,
              eval_n_episodes=5,
              successful_score=1,
          )
          assert len(warns) == 0, warns[0]
  
      # The agent returned by train_agent_async is not guaranteed to be
      # successful because parameters could be modified by other processes
      # after success. Thus here the successful model is loaded explicitly.
      if require_success:
          agent.load(os.path.join(self.outdir, "successful"))
  
      # Test
      env = make_env(0, True)
      n_test_runs = 5
      eval_returns, _ = run_evaluation_episodes(
          env,
          agent,
          n_steps=None,
          n_episodes=n_test_runs,
          max_episode_len=max_episode_len,
      )
      successful_return = 1
      if require_success:
          n_succeeded = np.sum(
              np.asarray(eval_returns) >= successful_return
          )
          assert n_succeeded == n_test_runs
  
imports: import logging
  import os
  import tempfile
  import warnings
  import numpy
  import pytest
  import torch
  from torch import nn
  import pfrl
  from pfrl.agents import a3c
  from pfrl.envs.abc import ABC
  from pfrl.experiments.evaluator import run_evaluation_episodes
  from pfrl.experiments.train_agent_async import train_agent_async
  from pfrl.nn import RecurrentBranched, RecurrentSequential
  from pfrl.policies import GaussianHeadWithStateIndependentCovariance, SoftmaxCategoricalHead
label_desc: Use image node_id 5 for calling the _TestA3C obj's underlying member method code with example usage: obj._test_abc(t_max, recurrent, discrete, episodic, steps, require_success) and returns: ABC