docstr: Initializes a LeagueBuilder instance.
  
  Args:
      algo: The Algorithm object by which this league builder is used.
          Algorithm calls `build_league()` after each training step.
      algo_config: The (not yet validated) config to be
          used on the Algorithm. Child classes of `LeagueBuilder`
          should preprocess this to add e.g. multiagent settings
          to this config.
docstr_tok: ["Initializes","a","LeagueBuilder","instance",".","Args",":","algo",":","The","Algorithm","object","by","which","this","league","builder","is","used",".","Algorithm","calls","`","build_league","(",")","`","after","each","training","step",".","algo_config",":","The","(","not","yet","validated",")","config","to","be","used","on","the","Algorithm",".","Child","classes","of","`","LeagueBuilder","`","should","preprocess","this","to","add","e.g",".","multiagent","settings","to","this","config","."]
code: def __init__(self, algo: Algorithm, algo_config: AlgorithmConfig):
      """Initializes a LeagueBuilder instance.
  
      Args:
          algo: The Algorithm object by which this league builder is used.
              Algorithm calls `build_league()` after each training step.
          algo_config: The (not yet validated) config to be
              used on the Algorithm. Child classes of `LeagueBuilder`
              should preprocess this to add e.g. multiagent settings
              to this config.
      """
      self.algo = algo
      self.config = algo_config
  
imports: import logging
  import re
  from abc import ABCMeta
  from collections import defaultdict
  from typing import Any, DefaultDict, Dict
  import numpy
  from ray.rllib.algorithms.algorithm import Algorithm
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig
  from ray.rllib.examples.policy.random_policy import RandomPolicy
  from ray.rllib.policy.policy import PolicySpec
  from ray.rllib.utils.annotations import ExperimentalAPI, override
  from ray.rllib.utils.numpy import softmax
  from ray.rllib.utils.typing import PolicyID, ResultDict
label_desc: Use image node_id 1 to create a new LeagueBuilder object  with example: obj = LeagueBuilder(algo, algo_config)