code: def _set_max_value(self, max_value):
          
  
          self._external_max_value = max_value
  
          # Check that the current value of the parameter is still within the boundaries. If not, issue a warning
  
          if self._external_max_value is not None and self.value > self._external_max_value:
  
              warnings.warn("The current value of the parameter %s (%s) "
                            "was above the new maximum %s." % (self.name, self.value, self._external_max_value),
                            exceptions.RuntimeWarning)
              self.value = self._external_max_value
docs: Sets current maximum allowed value