code: def run_test_experiment(exp_name, exp_id, root_dir):
      T2 = datetime.datetime(1999, 5, 5, 5, 5, 5, 5)
      T3 = datetime.datetime(1999, 5, 5, 6, 6, 6, 6)
  
      run_date = sample_run()
      run_date["ex_info"]["name"] = exp_name
      run_date["_id"] = exp_id
  
      # Create
      tinydb_obs = TinyDbObserver.create(path=root_dir)
  
      # Start exp 1
      tinydb_obs.started_event(**run_date)
  
      # Heartbeat
      info = {"my_info": [1, 2, 3], "nr": 7}
      outp = "some output"
      tinydb_obs.heartbeat_event(
          info=info, captured_out=outp, beat_time=T2, result=7
      )
      # Add Artifact
      filename = "sacred/__about__.py"
      name = "about"
      tinydb_obs.artifact_event(name, filename)
  
      # Add Resource
      filename = "sacred/__init__.py"
      tinydb_obs.resource_event(filename)
  
      # Complete
      tinydb_obs.completed_event(stop_time=T3, result=42)
  
      return tinydb_obs
  
imports: from __future__ import division, print_function, unicode_literals, absolute_import
  import datetime
  import os
  import tempfile
  import io
  import pytest
  from tinydb import Query
  from sacred.dependencies import get_digest
  from sacred.observers.tinydb_hashfs import TinyDbObserver, TinyDbReader
label_desc: Use image node_id 2 for calling a global function with example usage: run_test_experiment(exp_name, exp_id, root_dir) and returns: tinydb_obs