def idx_or_default( arr, idx, default ):
    """
    Like arr.get( idx, default ) except that arr is a list and lists
    don't have a get attribute
    """
    try:
        return arr[idx]
    except IndexError:
        return default