@classmethod
    def _listen_on_attribute(cls, attribute, coerce, parent_cls):
        key = attribute.key
        if parent_cls is not attribute.class_:
            return

        # rely on "propagate" here
        parent_cls = attribute.class_

        listen_keys = cls._get_listen_keys(attribute)

        def load(state, *args):
            """Listen for objects loaded or refreshed.

            Wrap the target data member's value with
            ``Mutable``.

            """
            val = state.dict.get(key, None)
            if val is not None:
                if coerce:
                    val = cls.coerce(key, val)
                    state.dict[key] = val
                val._parents[state.obj()] = key

        def load_attrs(state, ctx, attrs):
            if not attrs or listen_keys.intersection(attrs):
                load(state)

        def set(target, value, oldvalue, initiator):
            """Listen for set/replace events on the target
            data member.

            Establish a weak reference to the parent object
            on the incoming value, remove it for the one
            outgoing.

            """
            if value is oldvalue:
                return value

            if not isinstance(value, cls):
                value = cls.coerce(key, value)
            if value is not None:
                value._parents[target.obj()] = key
            if isinstance(oldvalue, cls):
                oldvalue._parents.pop(target.obj(), None)
            return value

        def pickle(state, state_dict):
            val = state.dict.get(key, None)
            if val is not None:
                if 'ext.mutable.values' not in state_dict:
                    state_dict['ext.mutable.values'] = []
                state_dict['ext.mutable.values'].append(val)

        def unpickle(state, state_dict):
            if 'ext.mutable.values' in state_dict:
                for val in state_dict['ext.mutable.values']:
                    val._parents[state.obj()] = key

        event.listen(parent_cls, 'load', load,
                     raw=True, propagate=True)
        event.listen(parent_cls, 'refresh', load_attrs,
                     raw=True, propagate=True)
        event.listen(parent_cls, 'refresh_flush', load_attrs,
                     raw=True, propagate=True)
        event.listen(attribute, 'set', set,
                     raw=True, retval=True, propagate=True)
        event.listen(parent_cls, 'pickle', pickle,
                     raw=True, propagate=True)
        event.listen(parent_cls, 'unpickle', unpickle,
                     raw=True, propagate=True)
Generates a wiki page.
dataset/ETHPy150Open zzzeek/sqlalchemy/lib/sqlalchemy/ext/mutable.py/MutableBase._listen_on_attribute--crossover with--dataset/ETHPy150Open libyal/libyal/scripts/overview-generate.py/OverviewWikiPageGenerator.Generate