def reference(object, callback=None, **annotations):
    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
Return an annotated weak ref.
dataset/ETHPy150Open jek/flatland/flatland/util/weakrefs.py/reference