def getArg(seq, index, default=None, func=lambda x: x):
    """Returns func(seq[index]), or 'default' if it's an invalid index"""
    try:
        return func(seq[index])
    except IndexError:
        return default