class_docstr: The main API for garage environments.
  
  The public API methods are:
  
  +-----------------------+
  | Functions             |
  +=======================+
  | reset()               |
  +-----------------------+
  | step()                |
  +-----------------------+
  | render()              |
  +-----------------------+
  | visualize()           |
  +-----------------------+
  | close()               |
  +-----------------------+
  
  Set the following properties:
  
  +-----------------------+-------------------------------------------------+
  | Properties            | Description                                     |
  +=======================+=================================================+
  | action_space          | The action space specification                  |
  +-----------------------+-------------------------------------------------+
  | observation_space     | The observation space specification             |
  +-----------------------+-------------------------------------------------+
  | spec                  | The environment specifications                  |
  +-----------------------+-------------------------------------------------+
  | render_modes          | The list of supported render modes              |
  +-----------------------+-------------------------------------------------+
  
  Example of a simple rollout loop:
  
  .. code-block:: python
  
      env = MyEnv()
      policy = MyPolicy()
      first_observation, episode_info = env.reset()
      env.visualize()  # visualization window opened
  
      episode = []
      # Determine the first action
      first_action = policy.get_action(first_observation, episode_info)
      episode.append(env.step(first_action))
  
      while not episode[-1].last():
         action = policy.get_action(episode[-1].observation)
         episode.append(env.step(action))
  
      env.close()  # visualization window closed
  
  Make sure your environment is pickle-able:
      Garage pickles the environment via the `cloudpickle` module
      to save snapshots of the experiment. However, some environments may
      contain attributes that are not pickle-able (e.g. a client-server
      connection). In such cases, override `__setstate__()` and
      `__getstate__()` to add your custom pickle logic.
  
      You might want to refer to the EzPickle module:
      https://github.com/openai/gym/blob/master/gym/utils/ezpickle.py
      for a lightweight way of pickle and unpickle via constructor
      arguments.
class_docstr_tok: ["The","main","API","for","garage","environments",".","The","public","API","methods","are",":","+","--","--","--","--","--","--","--","--","--","--","--","-+","|","Functions","|","+=======================+","|","reset","(",")","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","|","step","(",")","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","|","render","(",")","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","|","visualize","(",")","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","|","close","(",")","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","Set","the","following","properties",":","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","Properties","|","Description","|","+=======================+=================================================+","|","action_space","|","The","action","space","specification","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","observation_space","|","The","observation","space","specification","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","spec","|","The","environment","specifications","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","|","render_modes","|","The","list","of","supported","render","modes","|","+","--","--","--","--","--","--","--","--","--","--","--","-+","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","--","-+","Example","of","a","simple","rollout","loop",":","..","code-block",":",":","python","env","=","MyEnv","(",")","policy","=","MyPolicy","(",")","first_observation",",","episode_info","=","env.reset","(",")","env.visualize","(",")","#","visualization","window","opened","episode","=","[","]","#","Determine","the","first","action","first_action","=","policy.get_action","(","first_observation",",","episode_info",")","episode.append","(","env.step","(","first_action",")",")","while","not","episode","[","-1","]",".last","(",")",":","action","=","policy.get_action","(","episode","[","-1","]",".observation",")","episode.append","(","env.step","(","action",")",")","env.close","(",")","#","visualization","window","closed","Make","sure","your","environment","is","pickle-able",":","Garage","pickles","the","environment","via","the","`","cloudpickle","`","module","to","save","snapshots","of","the","experiment",".","However",",","some","environments","may","contain","attributes","that","are","not","pickle-able","(","e.g",".","a","client-server","connection",")",".","In","such","cases",",","override","`","__setstate__","(",")","`","and","`","__getstate__","(",")","`","to","add","your","custom","pickle","logic",".","You","might","want","to","refer","to","the","EzPickle","module",":","https",":","\/\/github.com\/openai\/gym\/blob\/master\/gym\/utils\/ezpickle.py","for","a","lightweight","way","of","pickle","and","unpickle","via","constructor","arguments","."]
docstr: Renders the environment.
  
  The set of supported modes varies per environment. By convention,
  if mode is:
  
  * rgb_array: Return an `numpy.ndarray` with shape (x, y, 3) and type
      uint8, representing RGB values for an x-by-y pixel image, suitable
      for turning into a video.
  * ansi: Return a string (str) or `StringIO.StringIO` containing a
      terminal-style text representation. The text can include newlines
      and ANSI escape sequences (e.g. for colors).
  
  Make sure that your class's `render_modes` includes the list of
  supported modes.
  
  For example:
  
  .. code-block:: python
  
      class MyEnv(Environment):
          def render_modes(self):
              return ['rgb_array', 'ansi']
  
          def render(self, mode):
              if mode == 'rgb_array':
                  return np.array(...)  # return RGB frame for video
              elif mode == 'ansi':
                  ...  # return text output
              else:
                  raise ValueError('Supported render modes are {}, but '
                                   'got render mode {} instead.'.format(
                                       self.render_modes, mode))
  
  Args:
      mode (str): the mode to render with. The string must be present in
          `self.render_modes`.
docstr_tok: ["Renders","the","environment",".","The","set","of","supported","modes","varies","per","environment",".","By","convention",",","if","mode","is",":","*","rgb_array",":","Return","an","`","numpy.ndarray","`","with","shape","(","x",",","y",",","3",")","and","type","uint8",",","representing","RGB","values","for","an","x-by-y","pixel","image",",","suitable","for","turning","into","a","video",".","*","ansi",":","Return","a","string","(","str",")","or","`","StringIO.StringIO","`","containing","a","terminal-style","text","representation",".","The","text","can","include","newlines","and","ANSI","escape","sequences","(","e.g",".","for","colors",")",".","Make","sure","that","your","class","'s","`","render_modes","`","includes","the","list","of","supported","modes",".","For","example",":","..","code-block",":",":","python","class","MyEnv","(","Environment",")",":","def","render_modes","(","self",")",":","return","[","'rgb_array","'",",","'ansi","'","]","def","render","(","self",",","mode",")",":","if","mode","==","'rgb_array","'",":","return","np.array","(","...",")","#","return","RGB","frame","for","video","elif","mode","==","'ansi","'",":","...","#","return","text","output","else",":","raise","ValueError","(","'Supported","render","modes","are","{","}",",","but","'","'got","render","mode","{","}","instead",".","'.format","(","self.render_modes",",","mode",")",")","Args",":","mode","(","str",")",":","the","mode","to","render","with",".","The","string","must","be","present","in","`","self.render_modes","`","."]
code: def render(self, mode):
      """Renders the environment.
  
      The set of supported modes varies per environment. By convention,
      if mode is:
  
      * rgb_array: Return an `numpy.ndarray` with shape (x, y, 3) and type
          uint8, representing RGB values for an x-by-y pixel image, suitable
          for turning into a video.
      * ansi: Return a string (str) or `StringIO.StringIO` containing a
          terminal-style text representation. The text can include newlines
          and ANSI escape sequences (e.g. for colors).
  
      Make sure that your class's `render_modes` includes the list of
      supported modes.
  
      For example:
  
      .. code-block:: python
  
          class MyEnv(Environment):
              def render_modes(self):
                  return ['rgb_array', 'ansi']
  
              def render(self, mode):
                  if mode == 'rgb_array':
                      return np.array(...)  # return RGB frame for video
                  elif mode == 'ansi':
                      ...  # return text output
                  else:
                      raise ValueError('Supported render modes are {}, but '
                                       'got render mode {} instead.'.format(
                                           self.render_modes, mode))
  
      Args:
          mode (str): the mode to render with. The string must be present in
              `self.render_modes`.
  
      """
  
imports: import abc
  from dataclasses import dataclass
  from typing import Dict
  import akro
  import numpy
  from garage._dtypes import StepType
label_desc: Use image node_id 7 for calling the Environment obj's underlying member method code with example usage: obj.render(mode) without return types