class_docstr: A test environment decorator class.
  
  This class provides additional functionality used for testing:
    - Accumulating reward over multiple frames.
    - Accumulating events over multiple frames.
    - Collecting RGB observations and saving them to image files.
class_docstr_tok: ["A","test","environment","decorator","class",".","This","class","provides","additional","functionality","used","for","testing",":","-","Accumulating","reward","over","multiple","frames",".","-","Accumulating","events","over","multiple","frames",".","-","Collecting","RGB","observations","and","saving","them","to","image","files","."]
docstr: Save RGB_INTERLEAVED observations collacted since the last reset call.
docstr_tok: ["Save","RGB_INTERLEAVED","observations","collacted","since","the","last","reset","call","."]
code: def save_frames(self, folder):
      """Save RGB_INTERLEAVED observations collacted since the last reset call."""
      if not os.path.exists(folder):
          os.makedirs(folder)
  
      for index, image_data in enumerate(self._rgb_history):
          image = Image.fromarray(np.uint8(image_data))
          image.save(os.path.join(folder, "frame{0}.png".format(index)))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import numpy
  from PIL import Image
label_desc: Use image node_id 14 for calling the TestEnvironmentDecorator obj's underlying member method code with example usage: obj.save_frames(folder) without return types