'annotate \'remote\' in primaryjoin, secondaryjoin
when the parent/child tables have some set of
tables in common, though is not a fully self-referential
relationship.'

def _annotate_remote_with_overlap(self):

    def visit_binary(binary):
        (binary.left, binary.right) = proc_left_right(binary.left, binary.right)
        (binary.right, binary.left) = proc_left_right(binary.right, binary.left)
    def proc_left_right(left, right):
        if (isinstance(left, expression.ColumnClause) and isinstance(right, expression.ColumnClause)):
            if (self.child_selectable.c.contains_column(right) and self.parent_selectable.c.contains_column(left)):
                right = right._annotate({'remote': True})
        else:
            self._warn_non_column_elements()
        return (left, right)
    self.primaryjoin = visitors.cloned_traverse(self.primaryjoin, {}, {'binary': visit_binary})
