code: def test_retry_fn():
      i = 0
  
      def fn():
          nonlocal i
          if i < 1:
              i += 1
              raise Exception("test")
          return "test"
  
      result = wandb_verify.retry_fn(fn)
      assert result == "test"
  
      j = 0
  
      def fn2():
          nonlocal j
          if j == 0:
              time.sleep(10)
          if j < 4:  # retry 4 times
              j += 1
              raise Exception("test")
          return "test"
  
      result = wandb_verify.retry_fn(fn2)
      assert result is None
  
file_path: wandb/tests/pytest_tests/unit_tests/test_wandb_verify.py
imports: import time
  import unittest.mock
  import wandb
  import wandb.sdk.verify.verify
  from wandb.apis import InternalApi
label_desc: Use image node_id 4 for calling a global function with example usage: test_retry_fn() and returns: str, str