def with_parent(self, instance, property=None):

        if property is None:
            mapper = object_mapper(instance)

            for prop in mapper.iterate_properties:
                if isinstance(prop, properties.RelationshipProperty) and \
                        prop.mapper is self._mapper_zero():
                    property = prop
                    break
            else:
                raise sa_exc.InvalidRequestError(
                    "Could not locate a property which relates instances "
                    "of class '%s' to instances of class '%s'" %
                    (
                        self._mapper_zero().class_.__name__,
                        instance.__class__.__name__)
                )

        return self.filter(with_parent(instance, property))
Record a string representation of the trait change dispatch
dataset/ETHPy150Open goFrendiAsgard/kokoropy/kokoropy/packages/sqlalchemy/orm/query.py/Query.with_parent--crossover with--dataset/ETHPy150Open enthought/traits/traits/util/event_tracer.py/ChangeEventRecorder.pre_tracer