code: def CalculateWaitForRetry(retry_attempt, max_wait=60):
      
  
      wait_time = 2 ** retry_attempt
      max_jitter = wait_time / 4.0
      wait_time += random.uniform(-max_jitter, max_jitter)
      return max(1, min(wait_time, max_wait))
docs: Calculates amount of time to wait before a retry attempt.
  
      Wait time grows exponentially with the number of attempts. A
      random amount of jitter is added to spread out retry attempts from
      different clients.
  
      Args:
        retry_attempt: Retry attempt counter.
        max_wait: Upper bound for wait time [seconds].
  
      Returns:
        Number of seconds to wait before retrying request.