def callable_reference(object, callback=None):
 if (hasattr(object, 'im_self') and (object.im_self is not None)):
  return BoundMethodWeakref(target=object, on_delete=callback)
 elif (hasattr(object, '__self__') and (object.__self__ is not None)):
  return BoundMethodWeakref(target=object, on_delete=callback)
 return annotatable_weakref(object, callback)

def callable_reference ( object , callback = None ) : if ( hasattr ( object , 'im_self' ) and ( object . im_self is not None ) ) : return BoundMethodWeakref ( target = object , on_delete = callback ) elif ( hasattr ( object , '__self__' ) and ( object . __self__ is not None ) ) : return BoundMethodWeakref ( target = object , on_delete = callback ) return annotatable_weakref ( object , callback )
return an annotated weak ref .