code: def test_archive() -> None:
      data = [1, 4.5, 12, 0]
      archive: utils.Archive[int] = utils.Archive()
      archive[np.array(data)] = 12
      np.testing.assert_equal(archive[np.array(data)], 12)
      np.testing.assert_equal(archive.get(data), 12)
      np.testing.assert_equal(archive.get([0, 12.0]), None)
      y = np.frombuffer(next(iter(archive.bytesdict.keys())))
      assert data in archive
      np.testing.assert_equal(y, data)
      items = list(archive.items_as_arrays())
      assert isinstance(items[0][0], np.ndarray)
      keys = list(archive.keys_as_arrays())
      assert isinstance(keys[0], np.ndarray)
      repr(archive)
      str(archive)
  
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 4 for calling a global function with example usage: test_archive() without return types