code: def test_deadline():
      before_start = time()
      deadline = Deadline.after(5)
      after_start = time()
  
      assert deadline.expired is False
      assert deadline.expires is True
      assert deadline.expires_at - deadline.started_at == 5
      assert 4 <= deadline.remaining <= 5
  
      deadline2 = Deadline(deadline.expires_at)
  
      assert deadline.expires_at == deadline2.expires_at
  
file_path: distributed/distributed/tests/test_deadline.py
imports: from __future__ import annotations
  import asyncio
  from time import sleep
  from distributed.metrics import time
  from distributed.utils import Deadline
  from distributed.utils_test import gen_test
label_desc: Use image node_id 1 for calling a global function with example usage: test_deadline() without return types