code: def mock_time() -> Iterator[MockTime]:
      """Mock out the now()/sleep() funcs used by the retry logic."""
      now = datetime.datetime.now()
  
      def _sleep(seconds):
          nonlocal now
          now += datetime.timedelta(seconds=seconds)
  
      async def _sleep_async(seconds):
          nonlocal now
          now += datetime.timedelta(seconds=seconds)
          await asyncio.sleep(
              1e-9
          )  # let the event loop shuffle stuff around
  
      with mock.patch(
          "wandb.sdk.lib.retry.NOW_FN",
          wraps=lambda: now,
      ) as mock_now, mock.patch(
          "wandb.sdk.lib.retry.SLEEP_FN", side_effect=_sleep
      ) as mock_sleep, mock.patch(
          "wandb.sdk.lib.retry.SLEEP_ASYNC_FN", side_effect=_sleep_async
      ) as mock_sleep_async:
          yield MockTime(
              now=mock_now,
              sleep=mock_sleep,
              sleep_async=mock_sleep_async,
          )
  
imports: import asyncio
  import dataclasses
  import datetime
  from typing import Iterator
  from unittest import mock
  import pytest
  from wandb.sdk.lib import retry
label_desc: Use image node_id 1 for calling a global function with example usage: mock_time() without return types