def METHOD_NAME(codes: dict) -> dict:  # pragma: no cover
    """Ensure that keys in codes are int's prior to storage in RMS."""
    newcodes = {}
    for code, name in codes.items():
        if code is None:
            continue  # skip codes of type None; assumed to be spurious
        if not isinstance(code, int):
            try:
                code = int(code)
            except ValueError:
                raise ValueError(
                    "The keys in codes must be an integer prior to RMS "
                    f"storage. Actual key found here is '{code}' of type {type(code)}"
                )
        newcodes[code] = name
    return newcodes