def METHOD_NAME(self, desired_keys: Sequence[str]) -> metadata.MetadataDictT:
    """Get value of all desired keys for the current image."""
    out = {}
    # The keys in the default config are of the form `group.subgroup.key`. However,
    # piexif only uses `key` for the indexing. Strip `group.subgroup` prefix for the
    # metadata extraction, but maintain the long key in the returned dict.
    desired_keys_map = {key.rpartition(".")[2]: key for key in desired_keys}
    if self._metadata is None:
        return {}
    try:
        for ifd in self._metadata:
            if ifd == "thumbnail":
                continue
            for tag in self._metadata[ifd]:
                keyname = piexif.TAGS[ifd][tag]["name"]
                keytype = piexif.TAGS[ifd][tag]["type"]
                val = self._metadata[ifd][tag]
                if keyname not in desired_keys_map:
                    continue
                if keytype in (
                    piexif.TYPES.Byte,
                    piexif.TYPES.Short,
                    piexif.TYPES.Long,
                    piexif.TYPES.SByte,
                    piexif.TYPES.SShort,
                    piexif.TYPES.SLong,
                    piexif.TYPES.Float,
                    piexif.TYPES.DFloat,
                ):  # integer and float
                    out[desired_keys_map[keyname]] = (keyname, str(val))
                elif keytype in (
                    piexif.TYPES.Ascii,
                    piexif.TYPES.Undefined,
                ):  # byte encoded
                    out[desired_keys_map[keyname]] = (keyname, val.decode())
                elif keytype in (
                    piexif.TYPES.Rational,
                    piexif.TYPES.SRational,
                ):  # (int, int) <=> numerator, denominator
                    out[desired_keys_map[keyname]] = (keyname, f"{val[0]}/{val[1]}")
    except KeyError:
        return {}
    return out