def METHOD_NAME(
    self, entity_urn: str, aspect_name: str, aspect: Optional[Aspect]
) -> Optional[Aspect]:
    in_glossary_terms: Optional[GlossaryTermsClass] = cast(
        Optional[GlossaryTermsClass], aspect
    )
    out_glossary_terms: GlossaryTermsClass = GlossaryTermsClass(
        terms=[],
        auditStamp=in_glossary_terms.auditStamp
        if in_glossary_terms is not None
        else AuditStampClass(
            time=builder.get_sys_time(), actor="urn:li:corpUser:restEmitter"
        ),
    )
    # Check if user want to keep existing terms
    if in_glossary_terms is not None and self.config.replace_existing is False:
        out_glossary_terms.terms.extend(in_glossary_terms.terms)
        out_glossary_terms.auditStamp = in_glossary_terms.auditStamp
    terms_to_add = self.config.get_terms_to_add(entity_urn)
    if terms_to_add is not None:
        out_glossary_terms.terms.extend(terms_to_add)
    patch_glossary_terms: Optional[GlossaryTermsClass] = None
    if self.config.semantics == TransformerSemantics.PATCH:
        assert self.ctx.graph
        patch_glossary_terms = AddDatasetTerms._merge_with_server_glossary_terms(
            self.ctx.graph, entity_urn, out_glossary_terms
        )
        return cast(Optional[Aspect], patch_glossary_terms)
    else:
        return cast(Aspect, out_glossary_terms)