import requests


def _is_temporal_problem(exception):
    """ Checks if the obtained exception is temporal and if download attempt should be repeated

    :param exception: Exception raised during download
    :type exception: Exception
    :return: `True` if exception is temporal and `False` otherwise
    :rtype: bool
    """
    return isinstance(exception, (requests.ConnectionError,
                                  requests.Timeout,
                                  requests.exceptions.ChunkedEncodingError))