def METHOD_NAME(
    tgt: pm.AnalysisResult,
    tgt_group_id: int,
    assessments: typing.Iterable[tuple[pm.Component, pm.Vulnerability, tuple[pm.Triage]]],
    protecode_client: protecode.client.ProtecodeApi,
):
    '''
    add assessments to given protecode "app"; skip given assessments that are not relevant for
    target "app" (either because there are already assessments, or vulnerabilities do not exit).
    Assessments are added "optimistically", ignoring version differences between source and target
    component versions (assumption: assessments are valid for all component-versions).
    '''
    tgt_components_by_name = collections.defaultdict(list)
    for c in tgt.components():
        tgt_components_by_name[c.name()].append(c)
    for component, vulnerability, triages in assessments:
        if not component.name() in tgt_components_by_name:
            continue
        for tgt_component in tgt_components_by_name[component.name()]:
            for tgt_vulnerability in tgt_component.vulnerabilities():
                if tgt_vulnerability.cve() != vulnerability.cve():
                    continue
                if tgt_vulnerability.historical():
                    continue
                if tgt_vulnerability.has_triage():
                    continue
                # vulnerability is still "relevant" (not obsolete and unassessed)
                break
            else:
                # vulnerability is not longer "relevant" -> skip
                continue
            product_id = tgt.product_id()
            for triage in triages:
                try:
                    protecode_client.add_triage(
                        triage=triage,
                        product_id=product_id,
                        group_id=tgt_group_id,
                        component_version=tgt_component.version(),
                    )
                except requests.exceptions.HTTPError as e:
                    # we will re-try importing every scan, so just print a warning
                    logger.warning(
                        f'An error occurred importing {triage=} to {component.name()=} '
                        f'in version {component.version()} for scan {product_id} '
                        f'{e}'
                    )