code: def compare_bandit_algos(
      algo_clss: List[Type[MABAlgo]],
      bandit_cls: Type[MAB],
      n_bandits: int,
      max_steps: int,
      update_every: int = 1,
      freeze_scores_btw_updates: bool = True,
      algo_kwargs: Optional[Union[Dict, List[Dict]]] = None,
      bandit_kwargs: Optional[Dict] = None,
  ) -> Tuple[List[str], List[np.ndarray]]:
      """
      Args:
          algo_clss: A list of MAB algorithm classes to be evaluated
          bandit_cls: Bandit class on which we perform evaluations
          n_bandits: Number of bandit instances among which the results are averaged
          max_steps: Number of time steps to simulate
          update_every: How many steps between the model is updated. 1 is online learning, >1 is iterative batch learning.
          freeze_scores_btw_updates: If True, the scores are frozen between model updates, otherwise at each step we generate
              new scores even if the model wasn't updated. `False` doesn't make sense for UCB models since the scores are deterministic
              and wouldn't change until the model is updated. Use `False` only for models with non-deterministic scores, like Thompson sampling.
          algo_kwargs: A dict (or list of dicts, one per algorightm class) of kwargs to pass to algo_cls at initialization
          bandit_kwargs: A dict of kwargs to pass to bandit_cls at initialization
      Returns:
          A list of algorithm names that were evaluated (based on class names)
          A list of cumulative regret trajectories (one per evaluated algorithm)
      """
      if algo_kwargs is None:
          algo_kwargs = {}
      if bandit_kwargs is None:
          bandit_kwargs = {}
      if isinstance(algo_kwargs, Dict):
          algo_kwargs = [algo_kwargs] * len(algo_clss)
      names = []
      pseudo_regrets = []
      for algo_cls, algo_kwargs_this_algo in zip(
          algo_clss, algo_kwargs
      ):
          names.append(algo_cls.__name__)
          pseudo_regrets.append(
              multiple_evaluations_bandit_algo(
                  algo_cls=algo_cls,
                  bandit_cls=bandit_cls,
                  n_bandits=n_bandits,
                  max_steps=max_steps,
                  update_every=update_every,
                  freeze_scores_btw_updates=freeze_scores_btw_updates,
                  algo_kwargs=algo_kwargs_this_algo,
                  bandit_kwargs=bandit_kwargs,
              )
          )
      return names, pseudo_regrets
  
imports: from abc import ABC, abstractmethod
  from functools import partial
  from multiprocessing import Pool
  from typing import Dict, List, Optional, Tuple, Type, Union
  import numpy
  import torch
  from reagent.mab.mab_algorithm import MABAlgo
  from torch import Tensor
label_desc: Use image node_id 3 for calling a global function with example usage: compare_bandit_algos(algo_clss, bandit_cls, n_bandits, max_steps, update_every, freeze_scores_btw_updates, algo_kwargs, bandit_kwargs) and returns: names,  pseudo_regrets