def _get_int(indexable_container, index, default):
    """try to get an int from an indexable container.  If that fails
    return the default"""
    try:
        return int(indexable_container[index])
    # exceptions separated to make case coverage clearer
    except (IndexError, KeyError):
        # item not found in the container
        return default
    except ValueError:
        # conversion to integer has failed
        return default