class_docstr: A trajectory of interactions with a RL environment.
  
  Trajectories are created when interacting with an RL environment. They can
  be prolonged and sliced and when completed, allow to re-calculate returns.
class_docstr_tok: ["A","trajectory","of","interactions","with","a","RL","environment",".","Trajectories","are","created","when","interacting","with","an","RL","environment",".","They","can","be","prolonged","and","sliced","and","when","completed",",","allow","to","re-calculate","returns","."]
docstr: Sets the `done` flag in the last timestep.
docstr_tok: ["Sets","the","`","done","`","flag","in","the","last","timestep","."]
code: def done(self, done):
      """Sets the `done` flag in the last timestep."""
      if not self._timesteps:
          raise ValueError("No interactions yet in the trajectory.")
      self._timesteps[-1] = self._timesteps[-1]._replace(done=done)
  
imports: import collections
  import os
  import gin
  import gym
  import numpy
  from trax import fastmath
  from trax.rl import advantages
  from trax.supervised import training
label_desc: Use image node_id 9 for calling the Trajectory obj's underlying member method code with example usage: obj.done(done) without return types