code: def _parse_memory(self, init_r, client, isOver):
      mem = client.memory
      if not isOver:
          last = mem[-1]
          mem = mem[:-1]
  
      mem.reverse()
      R = float(init_r)
      for k in mem:
          R = np.clip(k.reward, -1, 1) + GAMMA * R
          self.queue.put([k.state, k.action, R, k.prob])
  
      if not isOver:
          client.memory = [last]
      else:
          client.memory = []
  
imports: import argparse
  import cv2
  import gym
  import multiprocessing
  import numpy
  import os
  import sys
  import uuid
  import tensorflow
  from six.moves import queue
  from concurrent import futures
  from tensorpack import *
  from tensorpack.tfutils.gradproc import MapGradient, SummaryGradient
  from tensorpack.utils.concurrency import ensure_proc_terminate, start_proc_mask_signal
  from tensorpack.utils.gpu import get_num_gpu
  from tensorpack.utils.serialize import dumps
  from atari_wrapper import FireResetEnv, FrameStack, LimitLength, MapState
  from common import Evaluator, eval_model_multithread, play_n_episodes
  from simulator import SimulatorMaster, SimulatorProcess, TransitionExperience
label_desc: Use image node_id 6 for calling the MySimulatorMaster obj's underlying member method code with example usage: obj._parse_memory(init_r, client, isOver) without return types