code: def test_retries(client):
      args = [ZeroDivisionError("one"), ZeroDivisionError("two"), 42]
  
      with client.get_executor(retries=5, pure=False) as e:
          future = e.submit(varying(args))
          assert future.result() == 42
  
      with client.get_executor(retries=4) as e:
          future = e.submit(varying(args))
          result = future.result()
          assert result == 42
  
      with client.get_executor(retries=2) as e:
          future = e.submit(varying(args))
          with pytest.raises(ZeroDivisionError, match="two"):
              res = future.result()
  
      with client.get_executor(retries=0) as e:
          future = e.submit(varying(args))
          with pytest.raises(ZeroDivisionError, match="one"):
              res = future.result()
  
imports: from __future__ import annotations
  import random
  from concurrent.futures import FIRST_COMPLETED, FIRST_EXCEPTION, Future, TimeoutError, as_completed, wait
  from time import sleep
  import pytest
  from tlz import take
  from distributed.event import Event
  from distributed.metrics import time
  from distributed.utils import CancelledError
  from distributed.utils_test import inc, slowadd, slowinc, throws, varying
label_desc: Use image node_id 13 for calling a global function with example usage: test_retries(client) without return types