def validate( self, value ):
      """: Validate and return a valid value

      = ERROR CONDITIONS
      - Will throw an exception if the specified value is invalid.

      = INPUT VARIABLES
      - value   The value to set the instance of this property to.

      = RETURN VALUE
      - Returns a valid value.
      """
      if self.validator:
         try:
            result = self.validator( value )
            return result
         except Exception, e:
            name = self.name
            if self.owner:
               name = ( self.owner.__name__, name ) % "%s.%s"
            msg = "Error trying to validate the '%s' property." % name
            raise util.mergeExceptions( e, msg )
      else:
         # accept whatever it is given.
         return value

   #-----------------------------------------------------------------------
dataset/ETHPy150Open nasa/mplStyle/mplStyle/types/StyleProperty.py/StyleProperty.validate/swapped operands of `%`