def calculate_progress(total_count, count, start_progress = 0.0):
    """Calculates the progress in a way that is guaranteed to be safe
    from divizion by zero exceptions or any other exceptions. If there
    is any problem with the calculation or incoming arguments, this
    function will return 0.0"""
    default = 0.0
    progress = float(start_progress)
    if not (0.0 <= progress <= 1.0):
        return default
    if not (0 <= count <= total_count):
        return default
    try:
        progress += float(count) / float(total_count)
    except:
        pass
    assert type(progress) == float
    if not (0.0 <= progress <= 1.0):
        return default
    return progress