def define_association(self, rel_id, source_kind, source_keys, source_many,<EOL>source_conditional, source_phrase, target_kind, <EOL>target_keys, target_many, target_conditional, <EOL>target_phrase):
if isinstance(rel_id, int):<EOL><INDENT>rel_id = '<STR_LIT>' % rel_id<EOL><DEDENT>source_metaclass = self.find_metaclass(source_kind)<EOL>target_metaclass = self.find_metaclass(target_kind)<EOL>source_link = target_metaclass.add_link(source_metaclass, rel_id,<EOL>many=source_many,<EOL>phrase=target_phrase,<EOL>conditional=source_conditional)<EOL>target_link = source_metaclass.add_link(target_metaclass, rel_id,<EOL>many=target_many,<EOL>phrase=source_phrase,<EOL>conditional=target_conditional)<EOL>ass = Association(rel_id,<EOL>source_keys, source_link,<EOL>target_keys, target_link)<EOL>source_link.key_map = dict(zip(source_keys, target_keys))<EOL>target_link.key_map = dict(zip(target_keys, source_keys))<EOL>self.associations.append(ass)<EOL>return ass<EOL>
Define and return an association from one kind of class (the source 
kind) to some other kind of class (the target kind).