code: def test_set_get_limiter():
      class TestSuggestion(Searcher):
          def __init__(self, index):
              self.index = index
              self.returned_result = []
              super().__init__(metric="result", mode="max")
  
          def suggest(self, trial_id):
              self.index += 1
              return {"score": self.index}
  
          def on_trial_complete(self, trial_id, result=None, **kwargs):
              self.returned_result.append(result)
  
      searcher = TestSuggestion(0)
      limiter = ConcurrencyLimiter(searcher, max_concurrent=2)
      assert limiter.suggest("test_1")["score"] == 1
      assert limiter.suggest("test_2")["score"] == 2
      assert limiter.suggest("test_3") is None
  
      state = limiter.get_state()
      del limiter
      limiter2 = ConcurrencyLimiter(searcher, max_concurrent=3)
      limiter2.set_state(state)
      assert limiter2.suggest("test_4") is None
      assert limiter2.suggest("test_5") is None
      limiter2.on_trial_complete("test_1", {"result": 3})
      limiter2.on_trial_complete("test_2", {"result": 3})
      assert limiter2.suggest("test_3")["score"] == 3
  
file_path: ray/python/ray/tune/tests/test_searcher_utils.py
imports: import pytest
  from ray.tune.search import BasicVariantGenerator
  from ray.tune.search.repeater import Repeater
  from ray.tune.search import Searcher, ConcurrencyLimiter
  from ray.tune.search.search_generator import SearchGenerator
label_desc: Use image node_id 7 for calling a global function with example usage: test_set_get_limiter() and returns: dict