def METHOD_NAME(cls, d):
    # parse enumeration keys to int
    if "enumeration_colors" in d:
        d["enumeration_colors"] = {int(key): value for key, value in d["enumeration_colors"].items()}
    if "enumeration_legend" in d:
        d["enumeration_legend"] = {int(key): value for key, value in d["enumeration_legend"].items()}
    return cls(**d)