def METHOD_NAME(self, d):
    # validate against enumeration_colors
    enum_legend = d["value"]
    if not self.enumeration_colors:
        raise TypeError("Style enumeration_legend requires enumeration_colors")
    if set(enum_legend) != set(self.enumeration_colors):
        raise ValueError("Style enumeration_legend keys must match enumeration_colors keys")
    return enum_legend