def METHOD_NAME(
    info: EnumInfo,
    enum: Type[E],
    mapping: EnumMapping[E],
    context: Optional[AdaptContext],
) -> EnumLoadMap[E]:
    enc = conn_encoding(context.connection if context else None)
    rv: EnumLoadMap[E] = {}
    for label in info.labels:
        try:
            member = enum[label]
        except KeyError:
            # tolerate a missing enum, assuming it won't be used. If it is we
            # will get a DataError on fetch.
            pass
        else:
            rv[label.encode(enc)] = member
    if mapping:
        if isinstance(mapping, Mapping):
            mapping = list(mapping.items())
        for member, label in mapping:
            rv[label.encode(enc)] = member
    return rv