class_docstr: trpo class
class_docstr_tok: ["trpo","class"]
docstr: finish a trajectory
  :param done: whether the epoch is done
  :param next_state: next state
  :return: None
docstr_tok: ["finish","a","trajectory",":","param","done",":","whether","the","epoch","is","done",":","param","next_state",":","next","state",":","return",":","None"]
code: def finish_path(self, done, next_state):
      """
      finish a trajectory
      :param done: whether the epoch is done
      :param next_state: next state
      :return: None
      """
      if not done:
          next_state = np.array([next_state], np.float32)
          last_val = self.critic(next_state)
      else:
          last_val = 0
      self.buf.finish_path(last_val)
  
imports: import argparse
  import copy
  import os
  import threading
  import time
  import gym
  import matplotlib.pyplot
  import numpy
  import scipy.signal
  import tensorflow
  import tensorflow_probability
  import tensorlayer
label_desc: Use image node_id 15 for calling the TRPO obj's underlying member method code with example usage: obj.finish_path(done, next_state) without return types