def METHOD_NAME(self, attrs):
    for k, v in attrs.items():
        if k.endswith("_threshold") or k in ["oks_sigma", "line_thickness"]:
            if not 0 <= v <= 1:
                raise serializers.ValidationError(f"{k} must be in the range [0; 1]")
    return super().METHOD_NAME(attrs)