code: def test_save_live_glob_multi_write(
      relay_server, user, mock_run, backend_interface, mocker
  ):
      run = mock_run(use_magic_mock=True)
  
      mocker.patch(
          "wandb.filesync.dir_watcher.PolicyLive.RATE_LIMIT_SECONDS", 1
      )
      mocker.patch(
          "wandb.filesync.dir_watcher.PolicyLive.min_wait_for_size",
          lambda self, size: 1,
      )
  
      with relay_server() as relay, backend_interface(run) as interface:
          interface.publish_files(
              {"files": [("checkpoints/*", "live")]}
          )
          filesystem.mkdir_exists_ok(
              os.path.join(run.dir, "checkpoints")
          )
          test_file_1 = os.path.join(
              run.dir, "checkpoints", "test_1.txt"
          )
          test_file_2 = os.path.join(
              run.dir, "checkpoints", "test_2.txt"
          )
          # To debug this test adds some prints to the dir_watcher.py _on_file_* handlers
          print("Wrote file 1")
          with open(test_file_1, "w") as f:
              f.write("TEST TEST")
          time.sleep(2)
          print("Wrote file 1 2nd time")
          with open(test_file_1, "w") as f:
              f.write("TEST TEST TEST TEST")
          # File system polling happens every second
          time.sleep(1.5)
          print("Wrote file 2")
          with open(test_file_2, "w") as f:
              f.write("TEST TEST TEST TEST")
          print("Wrote file 1 3rd time")
          with open(test_file_1, "w") as f:
              f.write("TEST TEST TEST TEST TEST TEST")
          print("Stopping backend")
  
      uploaded_files = relay.context.get_run_uploaded_files(run.id)
  
      assert uploaded_files.count("checkpoints/test_1.txt") == 3
      assert uploaded_files.count("checkpoints/test_2.txt") == 1
  
imports: import json
  import os
  import shutil
  import threading
  import time
  import unittest.mock
  import pytest
  import wandb
  from wandb.errors import CommError
  from wandb.proto import wandb_internal_pb2
  from wandb.sdk.interface.interface import InterfaceBase
  from wandb.sdk.lib import filesystem
label_desc: Use image node_id 5 for calling a global function with example usage: test_save_live_glob_multi_write(relay_server, user, mock_run, backend_interface, mocker) without return types