def METHOD_NAME(subscriber):
    """
    Allow Subscribers to be garbage collected while still subscribed inside Publisher.
    Subscribing methods of objects is tricky::
        class TheObserver(object):
            def __init__(self):
                self.received_data = []
            def on_new_data(self, data):
                self.received_data.append(data)
        observer1 = TheObserver()
        observer2 = TheObserver()
        subscribe(observer1.on_new_data)
        subscribe(observer2.on_new_data)
        subscribe(observer2.on_new_data)
    Even if it looks like 2 different subscriptions they all
    pass 3 different bound-method objects (different id()).
    This is so since access via observer1.on_new_data
    creates new object (bound method) on the fly.
    We want to use weakref but weakref to bound method doesn't work
    see: http://code.activestate.com/recipes/81253/
    and : https://stackoverflow.com/questions/599430/why-doesnt-the-weakref-work-on-this-bound-method
    When we wrap bound-method into weakref it may quickly disappear
    if that is only reference to bound method.
    So, we need to unbind it to have access to real method + self instance
    Unbinding above 3 examples of on_new_data will give:
    1) self                      - 2 different id()
    2) function object of class  - all 3 have same id()
    Observer key is pair: (self-id, function-id)
    """
    try:
        self_or_none = six.get_method_self(subscriber)
        self_id = instance_id(self_or_none)
        self_or_none = weakref.proxy(self_or_none)
    except AttributeError:
        self_id = 0  # default for not bound methods
        self_or_none = None
    try:
        func = six.get_method_function(subscriber)
    except AttributeError:
        func = subscriber
    function_id = instance_id(func)
    subscription_key = (self_id, function_id)
    subscription_value = (self_or_none, weakref.proxy(func))
    return subscription_key, subscription_value