'Annotate the primaryjoin and secondaryjoin
structures with \'local\' annotations.
This annotates all column elements found
simultaneously in the parent table
and the join condition that don\'t have a
\'remote\' annotation set up from
_annotate_remote() or user-defined.'

def _annotate_local(self):

    if self._has_annotation(self.primaryjoin, 'local'):
        return
    if self._local_remote_pairs:
        local_side = util.column_set([l for (l, r) in self._local_remote_pairs])
    else:
        local_side = util.column_set(self.parent_selectable.c)
    def locals_(elem):
        if (('remote' not in elem._annotations) and (elem in local_side)):
            return elem._annotate({'local': True})
    self.primaryjoin = visitors.replacement_traverse(self.primaryjoin, {}, locals_)
