code: def max_validator(max_value):
      
      def validator(value):
          if value > max_value:
              raise ValidationError("{} is not <= {}".format(value, max_value))
  
      return validator
docs: Return validator function that ensures upper bound of a number.
  
      Result validation function will validate the internal value of resource
      instance field with the ``value >= min_value`` check.
  
      Args:
          max_value: maximum value for new validator