

def _obj_label(obj, extra_info=None, refcounts=False, shortnames=True):
    if shortnames:
        label = [_short_typename(obj)]
    else:
        label = [_long_typename(obj)]
    if refcounts:
        label[0] += (' [%d]' % (sys.getrefcount(obj) - 4))
    label.append(_safe_repr(obj))
    if extra_info:
        label.append(str(extra_info(obj)))
    return _quote('\n'.join(label))

dataset/ETHPy150Open Exa-Networks/exabgp/lib/exabgp/dep/objgraph.py _obj_label/original