code: def test_live_policy_file_upload(live_mock_server, test_settings):
      test_settings.update(
          {
              "start_method": "thread",
              "_live_policy_rate_limit": 2,
              "_live_policy_wait_time": 2,
          },
          source=wandb.sdk.wandb_settings.Source.INIT,
      )
  
      with wandb.init(settings=test_settings) as run:
          file_path, sent = "saveFile", 0
          # file created, should be uploaded
          with open(file_path, "w") as fp:
              fp.write("a" * 10000)
          run.save(file_path, policy="live")
          # on save file is sent
          sent += os.path.getsize(file_path)
          time.sleep(2.1)
          with open(file_path, "a") as fp:
              fp.write("a" * 10000)
          # 2.1 seconds is longer than set rate limit
          sent += os.path.getsize(file_path)
          # give watchdog time to register the change
          time.sleep(1.0)
          # file updated within modified time, should not be uploaded
          with open(file_path, "a") as fp:
              fp.write("a" * 10000)
          time.sleep(2.0)
          # file updated outside of rate limit should be uploaded
          with open(file_path, "a") as fp:
              fp.write("a" * 10000)
          sent += os.path.getsize(file_path)
          time.sleep(2)
  
      server_ctx = live_mock_server.get_ctx()
      print(server_ctx["file_bytes"], sent)
      assert "saveFile" in server_ctx["file_bytes"].keys()
      # TODO: bug sometimes it seems that on windows the first file is sent twice
      assert abs(server_ctx["file_bytes"]["saveFile"] - sent) <= 10000
  
file_path: wandb/tests/pytest_tests/unit_tests_old/test_core/test_wandb.py
imports: import importlib
  import os
  import platform
  import subprocess
  import time
  import pytest
  import wandb
  from tests.pytest_tests.unit_tests_old import utils
label_desc: Use image node_id 5 for calling a global function with example usage: test_live_policy_file_upload(live_mock_server, test_settings) without return types