def METHOD_NAME(dkt):
    """
    hook for json loading
    >>> import json
    >>> with open("some_file", 'r') as fp:
    ...     data = json.load(fp, object_hook=profile_hook)
    """
    dkt2 = dkt.copy()
    try:
        if "__ProfileDict__" in dkt:
            from PartSegCore.utils import ProfileDict
            del dkt["__ProfileDict__"]
            return ProfileDict(**dkt)
        if "__RadiusType__" in dkt:
            return RadiusType(dkt["value"])
        if "__SegmentationProperty__" in dkt:
            del dkt["__SegmentationProperty__"]
            return ROIExtractionProfile(**dkt)
        if "__SegmentationProfile__" in dkt:
            del dkt["__SegmentationProfile__"]
            return ROIExtractionProfile(**dkt)
        if (
            "__Serializable__" in dkt and dkt["__subtype__"] == "HistoryElement" and "algorithm_name" in dkt
        ):  # pragma: no cover
            # old code fix
            name = dkt["algorithm_name"]
            par = dkt["algorithm_values"]
            del dkt["algorithm_name"]
            del dkt["algorithm_values"]
            dkt["segmentation_parameters"] = {"algorithm_name": name, "values": par}
        if "__Serializable__" in dkt and dkt["__subtype__"] == "PartSegCore.color_image.base_colors.ColorMap":
            positions, colors = list(zip(*dkt["colormap"]))
            if any(isinstance(c, Color) for c in colors):
                colors = [c.as_tuple() if isinstance(c, Color) else (*c, 1) for c in colors]
            return Colormap(colors, controls=positions)
        if "__Serializable__" in dkt and dkt["__subtype__"] == "PartSegCore.color_image.base_colors.ColorPosition":
            return (dkt["color_position"], dkt["color"])
        if "__Serializable__" in dkt and dkt["__subtype__"] == "PartSegCore.color_image.base_colors.Color":
            return (dkt["red"] / 255, dkt["green"] / 255, dkt["blue"] / 255)
        if "__Colormap__" in dkt:
            del dkt["__Colormap__"]
            if dkt["controls"][0] != 0:
                dkt["controls"].insert(0, 0)
                dkt["colors"].insert(0, dkt["colors"][0])
            if dkt["controls"][-1] != 1:
                dkt["controls"].append(1)
                dkt["colors"].append(dkt["colors"][-1])
            return Colormap(**dkt)
    except Exception as e:  # pylint: disable=broad-except
        if problematic_fields := local_migrator.check_for_errors_in_dkt_values(dkt2):
            dkt2["__error__"] = f"Error in fields: {', '.join(problematic_fields)}"
            return dkt2
        dkt = dkt2
        dkt["__error__"] = str(e)
    return dkt