def validate_temperature_scale(scale):
    if scale not in [ t[0] for t in TEMPERATURE_SCALE_CHOICES ]:
        raise ValidationError("Invalid scale: please choose one from the list")
Validates the chosen temperature scale against the set 'indices'.
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/doc/plugins/samples/plugin/sample_resource/utils/validators.py/validate_temperature_scale