code: def test_insert_sync(self):
      trials = self.trials
      assert len(trials) == 0
      trials.insert_trial_doc(ok_trial("a", 8))
      assert len(trials) == 0
      trials.insert_trial_doc(ok_trial(5, a=1, b=3))
      assert len(trials) == 0
      trials.insert_trial_docs(
          [ok_trial(tid=4, a=2, b=3), ok_trial(tid=9, a=4, b=3)]
      )
      assert len(trials) == 0
      trials.refresh()
  
      assert len(trials) == 4, len(trials)
      assert len(trials) == len(trials.specs)
      assert len(trials) == len(trials.results)
      assert len(trials) == len(trials.miscs)
  
      trials.insert_trial_docs(
          trials.new_trial_docs(
              ["id0", "id1"],
              [dict(a=1), dict(a=2)],
              [dict(status="new"), dict(status="new")],
              [
                  dict(tid="id0", idxs={}, vals={}, cmd=None),
                  dict(tid="id1", idxs={}, vals={}, cmd=None),
              ],
          )
      )
  
      assert len(trials) == 4
      assert len(trials) == len(trials.specs)
      assert len(trials) == len(trials.results)
      assert len(trials) == len(trials.miscs)
  
      trials.refresh()
      assert len(trials) == 6
      assert len(trials) == len(trials.specs)
      assert len(trials) == len(trials.results)
      assert len(trials) == len(trials.miscs)
  
imports: import copy
  import unittest
  import numpy
  import bson
  from hyperopt.pyll import scope
  from hyperopt.base import JOB_STATE_DONE, JOB_STATE_NEW
  from hyperopt.base import TRIAL_KEYS
  from hyperopt.base import TRIAL_MISC_KEYS
  from hyperopt.base import InvalidTrial
  from hyperopt.base import miscs_to_idxs_vals
  from hyperopt.base import SONify
  from hyperopt.base import STATUS_OK
  from hyperopt.base import Trials
  from hyperopt.base import trials_from_docs
  from hyperopt.exceptions import AllTrialsFailed
label_desc: Use image node_id 3 for calling the TestTrials obj's underlying member method code with example usage: obj.test_insert_sync() without return types