code: def evaluate_all(
      experiments: Iterable[Tuple[Iterable[Estimator], int]],
      dataset: UCIMultiClassDataset,
      log_trainer: Trainer,
      log_epsilon: float,
      tgt_trainer: Trainer,
      tgt_epsilon: float,
      max_num_workers: int,
      random_reward_prob: float = 0.0,
      device=None,
  ):
      action_space = ActionSpace(dataset.num_actions)
      config_path = PurePath(dataset.config_file)
      data_name = config_path.stem
      log_model_name = (
          data_name + "_" + log_trainer.__class__.__name__ + ".pickle"
      )
      log_model_file = str(config_path.with_name(log_model_name))
      tgt_model_name = (
          data_name + "_" + tgt_trainer.__class__.__name__ + ".pickle"
      )
      tgt_model_file = str(config_path.with_name(tgt_model_name))
  
      log_trainer.load_model(log_model_file)
      tgt_trainer.load_model(tgt_model_file)
      if not log_trainer.is_trained or not tgt_trainer.is_trained:
          (
              train_x,
              train_y,
              train_r,
              val_x,
              val_y,
              val_r,
              test_x,
              test_y,
              test_r,
              train_choices,
          ) = dataset.train_val_test_split((0.2, 0.8))
          trainer_data = TrainingData(
              train_x, train_y, None, val_x, val_y, None
          )
          if not log_trainer.is_trained:
              log_trainer.train(trainer_data)
              log_trainer.save_model(log_model_file)
          if not tgt_trainer.is_trained:
              tgt_trainer.train(trainer_data)
              tgt_trainer.save_model(tgt_model_file)
  
      log_results = log_trainer.predict(dataset.features)
      assert log_results.probabilities is not None
      log_policy = MultiClassPolicy(
          action_space, log_results.probabilities, log_epsilon
      )
  
      tgt_results = tgt_trainer.predict(dataset.features)
      assert tgt_results.probabilities is not None
      tgt_policy = MultiClassPolicy(
          action_space, tgt_results.probabilities, tgt_epsilon
      )
  
      tasks = []
      # pyre-fixme[61]: `train_choices` may not be initialized here.
      test_queries = list(set(range(len(dataset))) - set(train_choices))
      for estimators, num_samples in experiments:
          samples = []
          for _ in range(num_samples):
              qid = random.sample(test_queries, 1)
              label = int(dataset.labels[qid].item())
              log_action, log_action_probabilities = log_policy(qid)
              log_reward = 1.0 if log_action.value == label else 0.0
              tgt_action, tgt_action_probabilities = tgt_policy(qid)
              ground_truth_reward = (
                  1.0 if tgt_action.value == label else 0.0
              )
              item_feature = dataset.features[qid]
              random_reward = random.random() < random_reward_prob
              samples.append(
                  LogSample(
                      context=qid,
                      log_action=log_action,
                      log_reward=random.randint(0, 1)
                      if random_reward
                      else log_reward,
                      log_action_probabilities=log_action_probabilities,
                      tgt_action_probabilities=tgt_action_probabilities,
                      tgt_action=tgt_action,
                      ground_truth_reward=ground_truth_reward,
                      item_feature=item_feature,
                  )
              )
          tasks.append(
              (
                  estimators,
                  BanditsEstimatorInput(action_space, samples, False),
              )
          )
  
      evaluator = Evaluator(tasks, max_num_workers)
      results = evaluator.evaluate()
      Evaluator.report_results(results)
      return results
  
imports: import argparse
  import json
  import logging
  import os
  import random
  import sys
  from dataclasses import dataclass
  from pathlib import PurePath
  from typing import Iterable, Tuple
  import numpy
  import pandas
  import torch
  from reagent.ope.estimators.contextual_bandits_estimators import Action, ActionDistribution, ActionRewards, BanditsEstimatorInput, BanditsModel, DMEstimator, DoublyRobustEstimator, IPSEstimator, LogSample
  from reagent.ope.estimators.estimator import Estimator, Evaluator
  from reagent.ope.estimators.types import ActionSpace, Policy, Trainer, TrainingData
  from reagent.ope.trainers.linear_trainers import DecisionTreeTrainer, LogisticRegressionTrainer, SGDClassifierTrainer
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: evaluate_all(experiments, dataset, log_trainer, log_epsilon, tgt_trainer, tgt_epsilon, max_num_workers, random_reward_prob, device) and returns: results