def getFirstValid(opts, default):
    """Returns the first valid entry from `opts`, or `default` if none found.
    Valid is defined as ``if o`` returns true."""
    for o in opts:
        if o: return o
    return default