from typing import List
from typing import Tuple


def _count_records_by_issue_code(records, severity) -> List[Tuple]:
    """
    Return a list of pairs (code, count) of the records with the specified
    severities.
    """
    code_to_count = {}
    for record in records:
        if record["Severity"] == severity:
            code = record["Code"]
            code_to_count[code] = code_to_count.get(code, 0) + 1
    return sorted(code_to_count.items(), key=lambda x: x[1], reverse=True)