code: def test_class_method(self, name, cls):
      n_arms = 5
      n_obs_per_arm = torch.randint(0, 50, size=(n_arms,)).float()
      n_success_per_arm = torch.rand(size=(n_arms,)) * n_obs_per_arm
      scores = cls.get_scores_from_batch(
          n_obs_per_arm, n_success_per_arm, n_success_per_arm
      )
  
      # UCB scores shape and type are correct
      self.assertEqual(scores.shape, (n_arms,))
      self.assertIsInstance(scores, torch.Tensor)
  
      if issubclass(cls, BaseUCB):
          avg_rewards = n_success_per_arm / n_obs_per_arm
  
          npt.assert_array_less(
              avg_rewards.numpy(),
              np.where(
                  n_obs_per_arm.numpy() >= 1,
                  scores.numpy(),
                  np.nan,
              ),
          )
  
imports: import unittest
  from io import BytesIO
  from itertools import cycle
  from unittest import mock
  import numpy
  import numpy.testing
  import torch
  from parameterized.parameterized import parameterized
  from pytorch_lightning import seed_everything
  from reagent.mab.mab_algorithm import get_arm_indices, place_values_at_indices, randomized_argmax, reindex_multiple_tensors
  from reagent.mab.simulation import BernoilliMAB, compare_bandit_algos, multiple_evaluations_bandit_algo, single_evaluation_bandit_algo
  from reagent.mab.thompson_sampling import BaseThompsonSampling, BernoulliBetaThompson, NormalGammaThompson
  from reagent.mab.ucb import BaseUCB, MetricUCB, UCB1, UCBTuned
label_desc: Use image node_id 3 for calling the TestMAB obj's underlying member method code with example usage: obj.test_class_method(name, cls) without return types