code: def test_fs_observer_started_event_creates_rundir_with_filesystem_delay(
      dir_obs, sample_run, monkeypatch
  ):
      """Assumes listdir doesn't show existing file (e.g. due to caching or delay of network storage)"""
      basedir, obs = dir_obs
      sample_run["_id"] = None
      _id = obs.started_event(**sample_run)
      assert _id == "1"
      assert os.listdir(str(basedir)) == [_id]
      with monkeypatch.context() as m:
          m.setattr("os.listdir", lambda _: [])
          assert os.listdir(str(basedir)) == []
          _id2 = obs.started_event(**sample_run)
          assert _id2 == "2"
  
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 6 for calling a global function with example usage: test_fs_observer_started_event_creates_rundir_with_filesystem_delay(dir_obs, sample_run, monkeypatch) without return types