class_docstr: The main OpenAI Gym class.
  
  It encapsulates an environment with arbitrary behind-the-scenes dynamics.
  An environment can be partially or fully observed.
  
  The main API methods that users of this class need to know are:
  
  - :meth:`step` - Takes a step in the environment using an action returning the next observation, reward,
    if the environment terminated and observation information.
  - :meth:`reset` - Resets the environment to an initial state, returning the initial observation and observation information.
  - :meth:`render` - Renders the environment observation with modes depending on the output
  - :meth:`close` - Closes the environment, important for rendering where pygame is imported
  
  And set the following attributes:
  
  - :attr:`action_space` - The Space object corresponding to valid actions
  - :attr:`observation_space` - The Space object corresponding to valid observations
  - :attr:`reward_range` - A tuple corresponding to the minimum and maximum possible rewards
  - :attr:`spec` - An environment spec that contains the information used to initialise the environment from `gym.make`
  - :attr:`metadata` - The metadata of the environment, i.e. render modes
  - :attr:`np_random` - The random number generator for the environment
  
  Note: a default reward range set to :math:`(-\infty,+\infty)` already exists. Set it if you want a narrower range.
class_docstr_tok: ["The","main","OpenAI","Gym","class",".","It","encapsulates","an","environment","with","arbitrary","behind-the-scenes","dynamics",".","An","environment","can","be","partially","or","fully","observed",".","The","main","API","methods","that","users","of","this","class","need","to","know","are",":","-",":","meth",":","`","step","`","-","Takes","a","step","in","the","environment","using","an","action","returning","the","next","observation",",","reward",",","if","the","environment","terminated","and","observation","information",".","-",":","meth",":","`","reset","`","-","Resets","the","environment","to","an","initial","state",",","returning","the","initial","observation","and","observation","information",".","-",":","meth",":","`","render","`","-","Renders","the","environment","observation","with","modes","depending","on","the","output","-",":","meth",":","`","close","`","-","Closes","the","environment",",","important","for","rendering","where","pygame","is","imported","And","set","the","following","attributes",":","-",":","attr",":","`","action_space","`","-","The","Space","object","corresponding","to","valid","actions","-",":","attr",":","`","observation_space","`","-","The","Space","object","corresponding","to","valid","observations","-",":","attr",":","`","reward_range","`","-","A","tuple","corresponding","to","the","minimum","and","maximum","possible","rewards","-",":","attr",":","`","spec","`","-","An","environment","spec","that","contains","the","information","used","to","initialise","the","environment","from","`","gym.make","`","-",":","attr",":","`","metadata","`","-","The","metadata","of","the","environment",",","i.e",".","render","modes","-",":","attr",":","`","np_random","`","-","The","random","number","generator","for","the","environment","Note",":","a","default","reward","range","set","to",":","math",":","`","(","-\\infty",",","+\\infty",")","`","already","exists",".","Set","it","if","you","want","a","narrower","range","."]
docstr: Compute the render frames as specified by render_mode attribute during initialization of the environment.
  
  The set of supported modes varies per environment. (And some
  third-party environments may not support rendering at all.)
  By convention, if render_mode is:
  
  - None (default): no render is computed.
  - human: render return None.
    The environment is continuously rendered in the current display or terminal. Usually for human consumption.
  - rgb_array: return a single frame representing the current state of the environment.
    A frame is a numpy.ndarray with shape (x, y, 3) representing RGB values for an x-by-y pixel image.
  - rgb_array_list: return a list of frames representing the states of the environment since the last reset.
    Each frame is a numpy.ndarray with shape (x, y, 3), as with `rgb_array`.
  - ansi: Return a strings (str) or StringIO.StringIO containing a
    terminal-style text representation for each time step.
    The text can include newlines and ANSI escape sequences (e.g. for colors).
  
  Note:
      Make sure that your class's metadata 'render_modes' key includes
      the list of supported modes. It's recommended to call super()
      in implementations to use the functionality of this method.
docstr_tok: ["Compute","the","render","frames","as","specified","by","render_mode","attribute","during","initialization","of","the","environment",".","The","set","of","supported","modes","varies","per","environment",".","(","And","some","third-party","environments","may","not","support","rendering","at","all",".",")","By","convention",",","if","render_mode","is",":","-","None","(","default",")",":","no","render","is","computed",".","-","human",":","render","return","None",".","The","environment","is","continuously","rendered","in","the","current","display","or","terminal",".","Usually","for","human","consumption",".","-","rgb_array",":","return","a","single","frame","representing","the","current","state","of","the","environment",".","A","frame","is","a","numpy.ndarray","with","shape","(","x",",","y",",","3",")","representing","RGB","values","for","an","x-by-y","pixel","image",".","-","rgb_array_list",":","return","a","list","of","frames","representing","the","states","of","the","environment","since","the","last","reset",".","Each","frame","is","a","numpy.ndarray","with","shape","(","x",",","y",",","3",")",",","as","with","`","rgb_array","`",".","-","ansi",":","Return","a","strings","(","str",")","or","StringIO.StringIO","containing","a","terminal-style","text","representation","for","each","time","step",".","The","text","can","include","newlines","and","ANSI","escape","sequences","(","e.g",".","for","colors",")",".","Note",":","Make","sure","that","your","class","'s","metadata","'render_modes","'","key","includes","the","list","of","supported","modes",".","It","'s","recommended","to","call","super","(",")","in","implementations","to","use","the","functionality","of","this","method","."]
code: def render(self) -> Optional[Union[RenderFrame, List[RenderFrame]]]:
      """Compute the render frames as specified by render_mode attribute during initialization of the environment.
  
      The set of supported modes varies per environment. (And some
      third-party environments may not support rendering at all.)
      By convention, if render_mode is:
  
      - None (default): no render is computed.
      - human: render return None.
        The environment is continuously rendered in the current display or terminal. Usually for human consumption.
      - rgb_array: return a single frame representing the current state of the environment.
        A frame is a numpy.ndarray with shape (x, y, 3) representing RGB values for an x-by-y pixel image.
      - rgb_array_list: return a list of frames representing the states of the environment since the last reset.
        Each frame is a numpy.ndarray with shape (x, y, 3), as with `rgb_array`.
      - ansi: Return a strings (str) or StringIO.StringIO containing a
        terminal-style text representation for each time step.
        The text can include newlines and ANSI escape sequences (e.g. for colors).
  
      Note:
          Make sure that your class's metadata 'render_modes' key includes
          the list of supported modes. It's recommended to call super()
          in implementations to use the functionality of this method.
      """
      raise NotImplementedError
  
imports: import sys
  from typing import TYPE_CHECKING, Any, Dict, Generic, List, Optional, SupportsFloat, Tuple, TypeVar, Union
  import numpy
  from gym import spaces
  from gym.logger import warn
  from gym.utils import seeding
label_desc: Use image node_id 5 for calling the Env obj's underlying member method code with example usage: obj.render() without return types