def render(self, mode='<STR_LIT>'):
if mode == '<STR_LIT>':<EOL><INDENT>if self.viewer is None:<EOL><INDENT>from ._image_viewer import ImageViewer<EOL>if self.spec is None:<EOL><INDENT>caption = self._rom_path.split('<STR_LIT:/>')[-<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>caption = self.spec.id<EOL><DEDENT>self.viewer = ImageViewer(<EOL>caption=caption,<EOL>height=SCREEN_HEIGHT,<EOL>width=SCREEN_WIDTH,<EOL>)<EOL><DEDENT>self.viewer.show(self.screen)<EOL><DEDENT>elif mode == '<STR_LIT>':<EOL><INDENT>return self.screen<EOL><DEDENT>else:<EOL><INDENT>render_modes = [repr(x) for x in self.metadata['<STR_LIT>']]<EOL>msg = '<STR_LIT>'.format('<STR_LIT:U+002CU+0020>'.join(render_modes))<EOL>raise NotImplementedError(msg)<EOL><DEDENT>
Render the environment.

Args:
    mode (str): the mode to render with:
    - human: render to the current display
    - rgb_array: Return an numpy.ndarray with shape (x, y, 3),
      representing RGB values for an x-by-y pixel image

Returns:
    a numpy array if mode is 'rgb_array', None otherwise