def class_associations(self, cn: ClassDefinitionName, must_render: bool=False) -> str:
<EOL>assocs: List[str] = []<EOL>if cn not in self.associations_generated and (not self.focus_classes or cn in self.focus_classes):<EOL><INDENT>cls = self.schema.classes[cn]<EOL>for slotname in self.filtered_cls_slots(cn, False)[::-<NUM_LIT:1>]:<EOL><INDENT>slot = self.schema.slots[slotname]<EOL>if slot.range in self.schema.classes:<EOL><INDENT>assocs.append(self.class_box(cn) + (yuml_inline if slot.inlined else yuml_ref) +<EOL>self.aliased_slot_name(slot) + self.prop_modifier(cls, slot) +<EOL>self.cardinality(slot) + '<STR_LIT:>>' + self.class_box(slot.range))<EOL><DEDENT><DEDENT>if cn in self.synopsis.rangerefs:<EOL><INDENT>for slotname in sorted(self.synopsis.rangerefs[cn]):<EOL><INDENT>slot = self.schema.slots[slotname]<EOL>if slot.domain in self.schema.classes and (slot.range != cls.name or must_render):<EOL><INDENT>assocs.append(self.class_box(slot.domain) + (yuml_inline if slot.inlined else yuml_ref) +<EOL>self.aliased_slot_name(slot) + self.prop_modifier(cls, slot) +<EOL>self.cardinality(slot) + '<STR_LIT:>>' + self.class_box(cn))<EOL><DEDENT><DEDENT><DEDENT>for mixin in cls.mixins:<EOL><INDENT>assocs.append(self.class_box(cn) + yuml_uses + self.class_box(mixin))<EOL><DEDENT>if cls.name in self.synopsis.mixinrefs:<EOL><INDENT>for mixin in sorted(self.synopsis.mixinrefs[cls.name].classrefs, reverse=True):<EOL><INDENT>assocs.append(self.class_box(ClassDefinitionName(mixin)) + yuml_uses + self.class_box(cn))<EOL><DEDENT><DEDENT>if cn in self.synopsis.applytos:<EOL><INDENT>for injector in sorted(self.synopsis.applytos[cn].classrefs, reverse=True):<EOL><INDENT>assocs.append(self.class_box(cn) + yuml_injected + self.class_box(ClassDefinitionName(injector)))<EOL><DEDENT><DEDENT>self.associations_generated.add(cn)<EOL>if cn in self.synopsis.isarefs:<EOL><INDENT>for is_a_cls in sorted(self.synopsis.isarefs[cn].classrefs, reverse=True):<EOL><INDENT>assocs.append(self.class_box(cn) + yuml_is_a + self.class_box(ClassDefinitionName(is_a_cls)))<EOL><DEDENT><DEDENT>if cls.is_a:<EOL><INDENT>assocs.append(self.class_box(cls.is_a) + yuml_is_a + self.class_box(cn))<EOL><DEDENT><DEDENT>return '<STR_LIT:U+002CU+0020>'.join(assocs)<EOL>
Emit all associations for a focus class.  If none are specified, all classes are generated

        @param cn: Name of class to be emitted
        @param must_render: True means render even if this is a target (class is specifically requested)
        @return: YUML representation of the association