original_docstring: Observe the current state of the game.
  
          Args:
              params:
              last_states:
          
docstring: Observe the current state of the game.
docstring_tokens: Observe the current state of the game .
code: def observe_state(self, params, last_states):
          """Observe the current state of the game.
  
          Args:
              params:
              last_states:
          """
          # read game state
          screen, game_features = process_buffers(self, params)
          variables = [self.properties[x[0]] for x in params.game_variables]
          last_states.append(GameState(screen, variables, game_features))
  
          # update most recent states
          if len(last_states) == 1:
              last_states.extend([last_states[0]] * (params.hist_size - 1))
          else:
              assert len(last_states) == params.hist_size + 1
              del last_states[0]
  
          # return the screen and the game features
          return screen, game_features
code_tokens: def observe_state ( self , params , last_states ) : screen , game_features = process_buffers ( self , params ) variables = [ self . properties [ x [ 0 ] ] for x in params . game_variables ] last_states . append ( GameState ( screen , variables , game_features ) ) if len ( last_states ) == 1 : last_states . extend ( [ last_states [ 0 ] ] * ( params . hist_size - 1 ) ) else : assert len ( last_states ) == params . hist_size + 1 del last_states [ 0 ] return screen , game_features
short_docstring: Observe the current state of the game.
short_docstring_tokens: Observe the current state of the game .
comment: """Observe the current state of the game.
  
          Args:
              params:
              last_states:
          """$SEP$# read game state$SEP$# update most recent states$SEP$# return the screen and the game features