code: def sync_wait_or_raise_err(
      attempt: int,
      err: Exception,
      max_attempts: float,
      backoff_multiplier: float,
      initial_backoff: float,
      max_backoff: float,
  ):
      """
      Accepts retry parameters and the underlying. The error is raised if the max_attempts has been reached otherwise the
      method waits based on the backoff calculations.
      :param attempt: Number of the current attempt.
      :param err: Underlying error that was raised by the operation.
      :param max_attempts: Maximum number of attempts that are allowed.
      :param backoff_multiplier: Factor that will be raised to the exponent of (attempt - 1) for calculating the backoff wait time.
      :param initial_backoff: The backoff time on the first error. This will be multiplied by the backoff_multiplier exponent for subsequent wait time calculations.
      :param max_backoff: The maximum backoff wait time.
      """
      if attempt == max_attempts:
          _raise_last_attempt(err, attempt)
      else:
          time.sleep(
              _wait_time(
                  attempt,
                  backoff_multiplier,
                  initial_backoff,
                  max_backoff,
              )
          )
  
file_path: jina/jina/clients/base/retry.py
imports: import random
  import asyncio
  import time
  import aiohttp
  import grpc
label_desc: Use image node_id 2 for calling a global function with example usage: sync_wait_or_raise_err(attempt, err, max_attempts, backoff_multiplier, initial_backoff, max_backoff) without return types