def _exceeded_threshold(number_of_retries: int, maximum_retries: int) -> bool:
    """Return True if the number of retries has been exceeded.

    Args:
        number_of_retries: The number of retry attempts made already.
        maximum_retries: The maximum number of retry attempts to make.

    Returns:
        True if the maximum number of retry attempts have already been
            made.
    """
    if maximum_retries is None:
        # Retry forever.
        return False

    return number_of_retries >= maximum_retries