class_docstr: Records demonstrations.
  
  A demonstration is a (observation, action, reward, discount) tuple where
  every element is a numpy array corresponding to a full episode.
class_docstr_tok: ["Records","demonstrations",".","A","demonstration","is","a","(","observation",",","action",",","reward",",","discount",")","tuple","where","every","element","is","a","numpy","array","corresponding","to","a","full","episode","."]
code: def step(self, timestep: dm_env.TimeStep, action: np.ndarray):
      reward = np.array(timestep.reward or 0, np.float32)
      self._episode_reward += reward
      self._episode.append(
          (
              timestep.observation,
              action,
              reward,
              np.array(timestep.discount or 0, np.float32),
          )
      )
  
imports: from typing import Any, List
  from absl import flags
  from bsuite.environments import deep_sea
  import dm_env
  import numpy
  import tensorflow
  import tree
label_desc: Use image node_id 2 for calling the DemonstrationRecorder obj's underlying member method code with example usage: obj.step(timestep, action) without return types