(retry_state: tenacity.RetryCallState)
return False
Specific check for auth error codes.

  Return True if we should retry.

  False otherwise.
  Args:
    retry_state: A retry state including exception to test for transience.

  Returns:
    True if we should retry. False otherwise.
Specific check for auth error codes.
Specific check for auth error codes .
def retry_auth_check(retry_state: tenacity.RetryCallState) -> bool:
  """Specific check for auth error codes.

  Return True if we should retry.

  False otherwise.
  Args:
    retry_state: A retry state including exception to test for transience.

  Returns:
    True if we should retry. False otherwise.
  """
  exception = retry_state.outcome.exception()
  attempt_number = retry_state.attempt_number
  now = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')

  if isinstance(exception, googleapiclient.errors.HttpError):
    if exception.resp.status in HTTP_AUTH_ERROR_CODES:
      _print_retry_error(attempt_number, MAX_AUTH_ATTEMPTS, exception)
      return True

  if not exception and attempt_number > 4:
    _print_error('{}: Retry SUCCEEDED'.format(now))

  return False
def retry_auth_check ( retry_state : tenacity . RetryCallState ) -> bool : exception = retry_state . outcome . exception ( ) attempt_number = retry_state . attempt_number now = datetime . datetime . now ( ) . strftime ( '%Y-%m-%d %H:%M:%S.%f' ) if isinstance ( exception , googleapiclient . errors . HttpError ) : if exception . resp . status in HTTP_AUTH_ERROR_CODES : _print_retry_error ( attempt_number , MAX_AUTH_ATTEMPTS , exception ) return True if not exception and attempt_number > 4 : _print_error ( '{}: Retry SUCCEEDED' . format ( now ) ) return False