class_docstr: An OpenSpiel RL environment loop.
  
  This takes `Environment` and list of `Actor` instances and coordinates their
  interaction. Agents are updated if `should_update=True`. This can be used as:
  
    loop = EnvironmentLoop(environment, actors)
    loop.run(num_episodes)
  
  A `Counter` instance can optionally be given in order to maintain counts
  between different Acme components. If not given a local Counter will be
  created to maintain counts between calls to the `run` method.
  
  A `Logger` instance can also be passed in order to control the output of the
  loop. If not given a platform-specific default logger will be used as defined
  by utils.loggers.make_default_logger. A string `label` can be passed to easily
  change the label associated with the default logger; this is ignored if a
  `Logger` instance is given.
class_docstr_tok: ["An","OpenSpiel","RL","environment","loop",".","This","takes","`","Environment","`","and","list","of","`","Actor","`","instances","and","coordinates","their","interaction",".","Agents","are","updated","if","`","should_update=True","`",".","This","can","be","used","as",":","loop","=","EnvironmentLoop","(","environment",",","actors",")","loop.run","(","num_episodes",")","A","`","Counter","`","instance","can","optionally","be","given","in","order","to","maintain","counts","between","different","Acme","components",".","If","not","given","a","local","Counter","will","be","created","to","maintain","counts","between","calls","to","the","`","run","`","method",".","A","`","Logger","`","instance","can","also","be","passed","in","order","to","control","the","output","of","the","loop",".","If","not","given","a","platform-specific","default","logger","will","be","used","as","defined","by","utils.loggers.make_default_logger",".","A","string","`","label","`","can","be","passed","to","easily","change","the","label","associated","with","the","default","logger",";","this","is","ignored","if","a","`","Logger","`","instance","is","given","."]
code: def _send_observation(self, timestep: dm_env.TimeStep, player: int):
      # If terminal all actors must update
      if player == pyspiel.PlayerId.TERMINAL:
          for player_id in range(len(self._actors)):
              # Note: we must account for situations where the first observation
              # is a terminal state, e.g. if an opponent folds in poker before we get
              # to act.
              if self._observed_first[player_id]:
                  player_timestep = self._get_player_timestep(
                      timestep, player_id
                  )
                  self._actors[player_id].observe(
                      self._prev_actions[player_id], player_timestep
                  )
                  if self._should_update:
                      self._actors[player_id].update()
          self._observed_first = [False] * len(self._actors)
          self._prev_actions = [pyspiel.INVALID_ACTION] * len(
              self._actors
          )
      else:
          if not self._observed_first[player]:
              player_timestep = dm_env.TimeStep(
                  observation=timestep.observation[player],
                  reward=None,
                  discount=None,
                  step_type=dm_env.StepType.FIRST,
              )
              self._actors[player].observe_first(player_timestep)
              self._observed_first[player] = True
          else:
              player_timestep = self._get_player_timestep(
                  timestep, player
              )
              self._actors[player].observe(
                  self._prev_actions[player], player_timestep
              )
              if self._should_update:
                  self._actors[player].update()
  
imports: import operator
  import time
  from typing import Optional, Sequence
  from acme import core
  from acme.utils import counting
  from acme.utils import loggers
  from acme.wrappers import open_spiel_wrapper
  import dm_env
  from dm_env import specs
  import numpy
  import tree
  import pyspiel
label_desc: Use image node_id 2 for calling the OpenSpielEnvironmentLoop obj's underlying member method code with example usage: obj._send_observation(timestep, player) without return types