def _get(indexable_container, index, default):
    """like 'get' on a dict, but it works on lists, too"""
    try:
        return indexable_container[index]
    except (IndexError, KeyError):
        return default