def ifset(var, a, b=''):
    """Checks the environment variable var; if it is set (non-empty), return a, otherwise return b.  Used in LexFormats to create tables with variations set by the environment."""
    import os
    if os.environ.get(var, ''):
        return a
    else:
        return b
