code: def test_uid_queue() -> None:
      uidq = utils.UidQueue()
      for uid in ["a", "b", "c"]:
          uidq.tell(uid)
      for uid in ["a", "b"]:
          assert uidq.ask() == uid
      uidq.tell("b")
      for uid in ["c", "b", "a", "c", "b", "a"]:
          assert uidq.ask() == uid
      # discarding (in asked, and in told)
      uidq.discard("b")
      for uid in ["c", "a", "c", "a"]:
          assert uidq.ask() == uid
      uidq.tell("a")
      uidq.discard("a")
      for uid in ["c", "c"]:
          assert uidq.ask() == uid
      # pickling
      string = pickle.dumps(uidq)
      pickle.loads(string)
      # clearing
      uidq.clear()
      with pytest.raises(RuntimeError):
          uidq.ask()
  
file_path: nevergrad/nevergrad/optimization/test_utils.py
imports: import pickle
  import pytest
  import numpy
  import nevergrad
  from nevergrad.common import testing
  from .test_base import CounterFunction
  from .None import experimentalvariants
  from .None import utils
label_desc: Use image node_id 8 for calling a global function with example usage: test_uid_queue() without return types