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","."]
docstr: Perform the run loop.
  
  Run the environment loop either for `num_episodes` episodes or for at
  least `num_steps` steps (the last episode is always run until completion,
  so the total number of steps may be slightly more than `num_steps`).
  At least one of these two arguments has to be None.
  
  Upon termination of an episode a new episode will be started. If the number
  of episodes and the number of steps are not given then this will interact
  with the environment infinitely.
  
  Args:
    num_episodes: number of episodes to run the loop for.
    num_steps: minimal number of steps to run the loop for.
  
  Raises:
    ValueError: If both 'num_episodes' and 'num_steps' are not None.
docstr_tok: ["Perform","the","run","loop",".","Run","the","environment","loop","either","for","`","num_episodes","`","episodes","or","for","at","least","`","num_steps","`","steps","(","the","last","episode","is","always","run","until","completion",",","so","the","total","number","of","steps","may","be","slightly","more","than","`","num_steps","`",")",".","At","least","one","of","these","two","arguments","has","to","be","None",".","Upon","termination","of","an","episode","a","new","episode","will","be","started",".","If","the","number","of","episodes","and","the","number","of","steps","are","not","given","then","this","will","interact","with","the","environment","infinitely",".","Args",":","num_episodes",":","number","of","episodes","to","run","the","loop","for",".","num_steps",":","minimal","number","of","steps","to","run","the","loop","for",".","Raises",":","ValueError",":","If","both","'num_episodes","'","and","'num_steps","'","are","not","None","."]
code: def run(
      self,
      num_episodes: Optional[int] = None,
      num_steps: Optional[int] = None,
  ):
      """Perform the run loop.
  
      Run the environment loop either for `num_episodes` episodes or for at
      least `num_steps` steps (the last episode is always run until completion,
      so the total number of steps may be slightly more than `num_steps`).
      At least one of these two arguments has to be None.
  
      Upon termination of an episode a new episode will be started. If the number
      of episodes and the number of steps are not given then this will interact
      with the environment infinitely.
  
      Args:
        num_episodes: number of episodes to run the loop for.
        num_steps: minimal number of steps to run the loop for.
  
      Raises:
        ValueError: If both 'num_episodes' and 'num_steps' are not None.
      """
  
      if not (num_episodes is None or num_steps is None):
          raise ValueError(
              'Either "num_episodes" or "num_steps" should be None.'
          )
  
      def should_terminate(episode_count: int, step_count: int) -> bool:
          return (
              num_episodes is not None and episode_count >= num_episodes
          ) or (num_steps is not None and step_count >= num_steps)
  
      episode_count, step_count = 0, 0
      while not should_terminate(episode_count, step_count):
          result = self.run_episode()
          episode_count += 1
          step_count += result["episode_length"]
          # Log the given results.
          self._logger.write(result)
  
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 6 for calling the OpenSpielEnvironmentLoop obj's underlying member method code with example usage: obj.run(num_episodes, num_steps) and returns: unknown