code: def test_no_duplicate(tmpdir, sample_run):
      obs = FileStorageObserver(tmpdir, copy_artifacts=False)
      file = Path(str(tmpdir / "koko.txt"))
      file.touch()
      obs.started_event(**sample_run)
      obs.resource_event(str(file))
      assert not os.path.exists(tmpdir / "_resources")
  
      # Test the test: that the resource would otherwise have been created.
      obs = FileStorageObserver(tmpdir, copy_artifacts=True)
      sample_run["_id"] = sample_run["_id"] + "_2"
      obs.started_event(**sample_run)
      obs.resource_event(str(file))
      assert os.path.exists(tmpdir / "_resources")
      assert any(
          x.startswith("koko")
          for x in os.listdir(tmpdir / "_resources")
      )
  
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 23 for calling a global function with example usage: test_no_duplicate(tmpdir, sample_run) without return types