code: def mocked_live_policy(monkeypatch, wandb_init):
      run = wandb_init()
      fpath = os.path.join(run.dir, "test_file")
      with open(fpath, "w") as fp:
          fp.write("")
  
      live_policy = PolicyLive(fpath, "saved_file", None, None)
  
      def spoof_save(live_policy):
          live_policy._last_sync = os.path.getmtime(
              live_policy.file_path
          )
          live_policy._last_uploaded_time = time.time()
          live_policy._last_uploaded_size = live_policy.current_size
  
      def spoof_min_wait_for_size(live_policy, size):
          return 1
  
      monkeypatch.setattr(PolicyLive, "save_file", spoof_save)
      monkeypatch.setattr(
          PolicyLive, "min_wait_for_size", spoof_min_wait_for_size
      )
      monkeypatch.setattr(PolicyLive, "RATE_LIMIT_SECONDS", 1)
  
      live_policy._last_uploaded_time = time.time() - 60
      yield live_policy
      run.finish()
  
file_path: wandb/tests/pytest_tests/system_tests/test_core/test_save_policies.py
imports: import os
  import time
  import pytest
  from wandb.filesync.dir_watcher import PolicyLive
label_desc: Use image node_id 1 for calling a global function with example usage: mocked_live_policy(monkeypatch, wandb_init) and returns: int