def validate_scale_values(scale):
 if (len(scale) < 2):
  raise exceptions.PlotlyError('You must input a list of scale values that has at least two values.')
 if ((scale[0] != 0) or (scale[(-1)] != 1)):
  raise exceptions.PlotlyError('The first and last number in your scale must be 0.0 and 1.0 respectively.')
 if (not all(((x < y) for (x, y) in zip(scale, scale[1:])))):
  raise exceptions.PlotlyError("'scale' must be a list that contains a strictly increasing sequence of numbers.")

def validate_scale_values ( scale ) : if ( len ( scale ) < 2 ) : raise exceptions . PlotlyError ( 'You must input a list of scale values that has at least two values.' ) if ( ( scale [ 0 ] != 0 ) or ( scale [ ( - 1 ) ] != 1 ) ) : raise exceptions . PlotlyError ( 'The first and last number in your scale must be 0.0 and 1.0 respectively.' ) if ( not all ( ( ( x < y ) for ( x , y ) in zip ( scale , scale [ 1 : ] ) ) ) ) : raise exceptions . PlotlyError ( "'scale' must be a list that contains a strictly increasing sequence of numbers." )
validates scale values from a colorscale .