

def attrs(attrs=[], terse=False, undefined=None):
    buf = []
    if bool(attrs):
        buf.append('')
        for (k, v) in attrs:
            if ((terse is not None) and isinstance(v, undefined)):
                continue
            if ((v != None) and ((v != False) or (type(v) != bool))):
                if ((k == 'class') and isinstance(v, (list, tuple))):
                    v = ' '.join(map(str, flatten(v)))
                t = ((v == True) and (type(v) == bool))
                if (t and (not terse)):
                    v = k
                buf.append((('%s' % k) if (terse and t) else ('%s="%s"' % (k, escape(v)))))
    return ' '.join(buf)

dataset/ETHPy150Open syrusakbary/pyjade/pyjade/runtime.py attrs/VarMisuse@55/60 `undefined`->`terse`