def METHOD_NAME(self, state):
    discriminator = self.parent_token.discriminator
    if isinstance(discriminator, hybrid_property):
        return getattr(state.obj(), discriminator.__name__)
    else:
        return state.attrs[discriminator.key].value