def _validate_preset(self, preset, mode=RAISE_MODE, default_preset=None):
        if default_preset is None:
            default_preset = ThreedlLutHelper.get_default_preset()
        # type must be 3D, there's no 1d/2d 3dl
        if presets.TYPE in preset and not preset[TYPE] == '3D':
            if mode == RAISE_MODE:
                raise PresetException(("'{0}' is not a valid type for 3dl LUT."
                                       "Choose '3D'"
                                       ).format(preset[TYPE]))
            preset[presets.TYPE] = default_preset[presets.TYPE]
        # check basic arguments
        preset = AbstractLUTHelper._validate_preset(self, preset, mode,
                                                    default_preset)
        # check shaper and mesh attributes
        specific_attr = [SHAPER, MESH]
        for attr in specific_attr:
            if attr not in preset:
                if mode == RAISE_MODE:
                    message = presets.MISSING_ATTR_MESSAGE.format(attr)
                    raise PresetException(message)
                preset[attr] = default_preset[attr]
            if not isinstance(preset[attr], bool):
                if mode == RAISE_MODE:
                    raise PresetException("{0} 3dl attribute must be a boolean"
                                          ).format(attr)
        # return updated preset
        return preset
dataset/ETHPy150Open mikrosimage/ColorPipe-tools/utils/threedl_helper.py/ThreedlLutHelper._validate_preset/original