code: def test_single_evaluation_update_every(self):
      num_steps = 100
      update_every = 10
  
      bandit = BernoilliMAB(num_steps, torch.tensor([0.3, 0.5]))
      algo = UCB1(n_arms=2)
      algo.add_batch_observations = mock.Mock()
      algo.get_action = mock.Mock(side_effect=cycle(["0", "1"]))
      regret_trajectory = single_evaluation_bandit_algo(
          bandit,
          algo,
          update_every=update_every,
          freeze_scores_btw_updates=False,
      )
      self.assertEqual(len(regret_trajectory), num_steps)
      self.assertEqual(
          algo.add_batch_observations.call_count,
          num_steps / update_every,
      )
      self.assertEqual(algo.get_action.call_count, num_steps)
  
      bandit = BernoilliMAB(num_steps, torch.tensor([0.3, 0.5]))
      algo = UCB1(n_arms=2)
      algo.add_batch_observations = mock.Mock()
      algo.get_action = mock.Mock(side_effect=cycle(["0", "1"]))
      regret_trajectory = single_evaluation_bandit_algo(
          bandit,
          algo,
          update_every=update_every,
          freeze_scores_btw_updates=True,
      )
      self.assertEqual(len(regret_trajectory), num_steps)
      self.assertEqual(
          algo.add_batch_observations.call_count,
          num_steps / update_every,
      )
      self.assertEqual(
          algo.get_action.call_count, num_steps / update_every
      )
  
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 TestSimulation obj's underlying member method code with example usage: obj.test_single_evaluation_update_every() without return types