code: def test_fs_observer_heartbeat_event_multiple_updates_run(
      dir_obs, sample_run
  ):
      basedir, obs = dir_obs
      _id = obs.started_event(**sample_run)
      run_dir = basedir.join(_id)
      info = {"my_info": [1, 2, 3], "nr": 7}
  
      captured_outs = [("some output %d\n" % i) for i in range(10)]
      beat_times = [
          (T2 + datetime.timedelta(seconds=i * 10)) for i in range(10)
      ]
  
      for idx in range(len(beat_times)):
          expected_captured_output = (
              "\n".join([x.strip() for x in captured_outs[: (idx + 1)]])
              + "\n"
          )
          obs.heartbeat_event(
              info=info,
              captured_out=expected_captured_output,
              beat_time=beat_times[idx],
              result=17,
          )
  
          assert (
              run_dir.join("cout.txt").read()
              == expected_captured_output
          )
          run = json.loads(run_dir.join("run.json").read())
  
          assert run["heartbeat"] == beat_times[idx].isoformat()
          assert run["result"] == 17
  
          assert run_dir.join("info.json").exists()
          i = json.loads(run_dir.join("info.json").read())
          assert info == i
  
imports: import datetime
  import os
  from copy import copy
  import pytest
  import json
  from pathlib import Path
  from sacred.observers.file_storage import FileStorageObserver
  from sacred.metrics_logger import ScalarMetricLogEntry, linearize_metrics
label_desc: Use image node_id 11 for calling a global function with example usage: test_fs_observer_heartbeat_event_multiple_updates_run(dir_obs, sample_run) without return types