def METHOD_NAME(request, clv, other_tag_or_hash):
    q = Q(tag=other_tag_or_hash)
    try:
        id = unhash(other_tag_or_hash, "CodelistVersion")
    except ValueError:
        pass
    else:
        q |= Q(id=id)
    other_clv = get_object_or_404(CodelistVersion.objects.filter(q))
    if clv.coding_system_id != other_clv.coding_system_id:
        raise Http404
    lhs_coding_system = clv.coding_system
    rhs_coding_system = other_clv.coding_system
    lhs_csv_data_codes_to_terms = get_csv_data_code_to_terms(clv)
    rhs_csv_data_codes_to_terms = get_csv_data_code_to_terms(other_clv)
    if lhs_coding_system.id == "dmd":
        if lhs_csv_data_codes_to_terms is None or rhs_csv_data_codes_to_terms is None:
            return HttpResponseBadRequest("Could not identify code columns")
        lhs_codes = set(lhs_csv_data_codes_to_terms)
        rhs_codes = set(rhs_csv_data_codes_to_terms)
    else:
        lhs_codes = set(clv.codes)
        rhs_codes = set(other_clv.codes)
    lhs_only_codes = set(lhs_codes) - set(rhs_codes)
    rhs_only_codes = rhs_codes - lhs_codes
    common_codes = lhs_codes & rhs_codes
    ctx = {
        "lhs": clv,
        "rhs": other_clv,
        "lhs_codes": lhs_codes,
        "rhs_codes": rhs_codes,
        "lhs_only_codes": lhs_only_codes,
        "rhs_only_codes": rhs_only_codes,
        "common_codes": common_codes,
        "lhs_only_summary": summarise(
            lhs_only_codes, lhs_coding_system, lhs_csv_data_codes_to_terms
        ),
        "rhs_only_summary": summarise(
            rhs_only_codes, rhs_coding_system, rhs_csv_data_codes_to_terms
        ),
        "common_summary": summarise(
            common_codes, lhs_coding_system, lhs_csv_data_codes_to_terms
        ),
    }
    return render(request, "codelists/version_diff.html", ctx)