

def reference(object, callback=None, **annotations):
    'Return an annotated weak ref.'
    if callable(object):
        weak = callable_reference(object, callback)
    else:
        weak = annotatable_weakref(object, callback)
    for (key, value) in annotations.items():
        setattr(weak, key, value)
    return weak

dataset/ETHPy150Open jek/flatland/flatland/util/weakrefs.py reference/original