code: def test_add_and_pickle(runhistory, config1):
      """
      simply adding some rundata to runhistory, then pickle it
      """
      assert runhistory.empty()
  
      runhistory.add(
          config=config1,
          cost=10,
          time=20,
          status=StatusType.SUCCESS,
          instance=None,
          seed=None,
          starttime=100,
          endtime=120,
          additional_info=None,
      )
  
      runhistory.add(
          config=config1,
          cost=10,
          time=20,
          status=StatusType.SUCCESS,
          instance=1,
          seed=12354,
          starttime=10,
          endtime=30,
          additional_info={"start_time": 10},
      )
  
      assert not runhistory.empty()
  
      tmpfile = tempfile.NamedTemporaryFile(mode="wb", delete=False)
      pickle.dump(runhistory, tmpfile, -1)
      name = tmpfile.name
      tmpfile.close()
  
      with open(name, "rb") as fh:
          loaded_runhistory = pickle.load(fh)
  
      assert loaded_runhistory._data == runhistory._data
  
imports: from __future__ import annotations
  import os
  import pickle
  import tempfile
  import pytest
  from smac.runhistory.runhistory import RunHistory, TrialKey
  from smac.runner.abstract_runner import StatusType
label_desc: Use image node_id 4 for calling a global function with example usage: test_add_and_pickle(runhistory, config1) without return types