def get(cap, *args, **kwargs):
    if 'READTHEDOCS' in os.environ:
        return ''
    if kwargs != {}:
        raise TypeError("get(): No such argument %r" % kwargs.popitem()[0])
    if _cache == {}:
        try:
            curses.setupterm()
        except:
            pass
    s = _cache.get(cap)
    if not s:
        s = curses.tigetstr(cap)
        if s == None:
            s = curses.tigetnum(cap)
            if s == -2:
                s = curses.tigetflag(cap)
                if s == -1:
                    s = ''
                else:
                    s = bool(s)
        _cache[cap] = s
    if args and s:
        r = curses.tparm(s, *args)
        return r.decode('utf-8')
    else:
        if isinstance(s, bytes):
            return s.decode('utf-8')
        else:
            return s