<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def monitor_deletion():
 """ Function for checking for correct deletion of weakref-able objects. Example usage:: monitor, is_alive = monitor_deletion() obj = set() monitor(obj, "obj") assert is_alive("obj") # True because there is a ref to `obj` is_alive del obj assert not is_alive("obj") # True because there `obj` is deleted """

    monitors = {}

    def set_deleted(x):
        def _(weakref):
            del monitors[x]
        return _

    def monitor(item, name):
        monitors[name] = ref(item, set_deleted(name))

    def is_alive(name):
        return monitors.get(name, None) is not None

    return monitor, is_alive