def get_full_template_name(temp_name: str):
    """Returns a fully qualified name of a metadata template in the form '<assay_name>'
    where <assay_name> is snake_case
    """
    # as AbbrevCamelCasePurpose
    for purpose in ["Assay", "Analysis", "Manifest"]:
        if temp_name.endswith(purpose):
            temp_name = temp_name[: -len(purpose)]
            break

    return "".join(
        [
            "_" + i if i != j and n else i
            for n, (i, j) in enumerate(zip(temp_name, temp_name.lower()))
        ]
    ).lower()