An environment variable is truthy if it exists and isn't one of (0, false, no, off)

def _is_env_truthy(name):
    """An environment variable is truthy if it exists and isn't one of (0, false, no, off)
    """
    if name not in os.environ:
        return False
    return os.environ.get(name).lower() not in ("0", "false", "no", "off")