code: def _check_range(self, value):
          
          if self.min is None and self.max is None:
              return
  
          measure = self.measure(value)
          prefix = "Value (%s) for parameter %s is invalid.  %s"
  
          if self.min is not None and measure < self.min:
              message = prefix % (value, self.name,
                                  self.lower_than_min_template % self.min)
              raise InvalidParameterValueError(message)
  
          if self.max is not None and measure > self.max:
              message = prefix % (value, self.name,
                                  self.greater_than_max_template % self.max)
              raise InvalidParameterValueError(message)
docs: Check that the given C{value} is in the expected range.