docstr: Test that timer keeps the number of samples within bounds
docstr_tok: ["Test","that","timer","keeps","the","number","of","samples","within","bounds"]
code: def test_timer_context_manager_size_bound(self) -> None:
      """Test that timer keeps the number of samples within bounds"""
      TEST_ACTION_STRING: str = "test action"
      UPPER_BOUND: int = 10
      LOWER_BOUND: int = 5
      timer = BoundedTimer(
          lower_bound=LOWER_BOUND, upper_bound=UPPER_BOUND
      )
      for i in range(1000):
          with timer.time(TEST_ACTION_STRING):
              pass
          if i > LOWER_BOUND:
              self.assertGreaterEqual(
                  len(timer.recorded_durations[TEST_ACTION_STRING]),
                  LOWER_BOUND,
              )
          self.assertLessEqual(
              len(timer.recorded_durations[TEST_ACTION_STRING]),
              UPPER_BOUND,
          )
  
imports: import os
  import time
  import unittest
  from datetime import timedelta
  from random import random
  from unittest import mock
  from unittest.mock import Mock, patch
  import torch
  import torch.distributed
  from pyre_extensions import none_throws
  from torchtnt.utils.test_utils import skip_if_not_distributed, skip_if_not_gpu, spawn_multi_process
  from torchtnt.utils.timer import BoundedTimer, FullSyncPeriodicTimer, get_durations_histogram, get_recorded_durations_table, get_synced_durations_histogram, get_timer_summary, log_elapsed_time, logger, Timer
label_desc: Use image node_id 3 for calling the TimerTest obj's underlying member method code with example usage: obj.test_timer_context_manager_size_bound() without return types