def METHOD_NAME(metric: Metric) -> Any:
    tot = sum(
        val / adjust[key] if adjust[key] else 0
        for key, val in asdict(metric.weight).items()
    )
    key = (
        -(metric.comp.always_on_top),
        -(metric.comp.preselect),
        -round(tot * metric.weight_adjust * 10000),
        -len(metric.comp.secondary_edits),
        -(metric.comp.kind != ""),
        -(metric.comp.doc is not None),
        -metric.comp.sort_by[:1].isalnum(),
        strxfrm(
            metric.comp.sort_by.swapcase() if is_lower else metric.comp.sort_by
        ),
    )
    return key