code: def _calculate_deadline(
      timeout: Optional[datetime.timedelta], propagate_deadline: bool
  ) -> datetime.datetime:
      """Calculate the out-bound deadline from timeout and existing deadline.
  
      Args:
        timeout: Timeout to apply to all calls. If set to None or a zero-length
          timedelta then no timeout is applied.
        propagate_deadline: Unsupported feature.
  
      Returns:
        Returns the sooner of (now + timeout) and the existing deadline.
      """
      deadline = datetime.datetime.max.replace(
          tzinfo=zoneinfo.ZoneInfo("UTC")
      )
      if timeout:
          deadline_timeout = (
              datetime.datetime.now(tz=zoneinfo.ZoneInfo("UTC"))
              + timeout
          )
          deadline = min(deadline, deadline_timeout)
      return deadline
  
imports: from concurrent import futures
  import datetime
  from typing import List, Optional, Union
  import zoneinfo
  from courier.python import py_client
  import numpy
  from pybind11_abseil.status import StatusNotOk
  from pybind11_abseil.status import StatusNotOk
label_desc: Use image node_id 3 for calling a global function with example usage: _calculate_deadline(timeout, propagate_deadline) and returns: deadline