class_docstr: This wrapper records videos of rollouts.
  
  Usually, you only want to record episodes intermittently, say every hundredth episode.
  To do this, you can specify **either** ``episode_trigger`` **or** ``step_trigger`` (not both).
  They should be functions returning a boolean that indicates whether a recording should be started at the
  current episode or step, respectively.
  If neither :attr:`episode_trigger` nor ``step_trigger`` is passed, a default ``episode_trigger`` will be employed.
  By default, the recording will be stopped once a `terminated` or `truncated` signal has been emitted by the environment. However, you can
  also create recordings of fixed length (possibly spanning several episodes) by passing a strictly positive value for
  ``video_length``.
class_docstr_tok: ["This","wrapper","records","videos","of","rollouts",".","Usually",",","you","only","want","to","record","episodes","intermittently",",","say","every","hundredth","episode",".","To","do","this",",","you","can","specify","*","*","either","*","*","``","episode_trigger","``","*","*","or","*","*","``","step_trigger","``","(","not","both",")",".","They","should","be","functions","returning","a","boolean","that","indicates","whether","a","recording","should","be","started","at","the","current","episode","or","step",",","respectively",".","If","neither",":","attr",":","`","episode_trigger","`","nor","``","step_trigger","``","is","passed",",","a","default","``","episode_trigger","``","will","be","employed",".","By","default",",","the","recording","will","be","stopped","once","a","`","terminated","`","or","`","truncated","`","signal","has","been","emitted","by","the","environment",".","However",",","you","can","also","create","recordings","of","fixed","length","(","possibly","spanning","several","episodes",")","by","passing","a","strictly","positive","value","for","``","video_length","``","."]
code: def _video_enabled(self):
      if self.step_trigger:
          return self.step_trigger(self.step_id)
      else:
          return self.episode_trigger(self.episode_id)
  
file_path: gym/gym/wrappers/record_video.py
imports: import os
  from typing import Callable, Optional
  import gym
  from gym import logger
  from gym.wrappers.monitoring import video_recorder
label_desc: Use image node_id 4 for calling the RecordVideo obj's underlying member method code with example usage: obj._video_enabled() and returns: self, self