def safeRef(target, onDelete = None):
    if hasattr(target, 'im_self'):
        if target.im_self is not None:
            # Turn a bound method into a BoundMethodWeakref instance.
            # Keep track of these instances for lookup by disconnect().
            assert hasattr(target, 'im_func'), """safeRef target %r has im_self, but no im_func, don't know how to create reference"""%( target,)
            reference = get_bound_method_weakref(
                target=target,
                onDelete=onDelete
            )
            return reference
    if callable(onDelete):
        return weakref.ref(target, onDelete)
    else:
        return weakref.ref( target )
varargslist_list : COMMA fpdef
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/dispatch/saferef.py/safeRef--crossover with--dataset/ETHPy150Open nucleic/enaml/enaml/core/parser.py/p_varargslist_list1