'Produce a proxied \'any\' expression using EXISTS.
This expression will be a composed product
using the :meth:`.RelationshipProperty.Comparator.any`
and/or :meth:`.RelationshipProperty.Comparator.has`
operators of the underlying proxied attributes.'

def any(self, criterion=None, **kwargs):

    if self._value_is_scalar:
        value_expr = getattr(self.target_class, self.value_attr).has(criterion, **kwargs)
    else:
        value_expr = getattr(self.target_class, self.value_attr).any(criterion, **kwargs)
    if (self.scalar and (not self._value_is_scalar)):
        return self._comparator.has(value_expr)
    else:
        return self._comparator.any(value_expr)
