from typing import Mapping


def from_trace_codes_text(codes_text: str) -> Mapping[int, str]:
    """
    Convert a trace codes text to dictionary.
    :param codes_text: Trace codes file data.
    :return: Mapping between code and event name.
    """
    return {int(s[0], 16): s[1] for s in map(lambda l: l.split(), codes_text.splitlines())}