code: def validate(self):
          
          super(ByteSizeFilter, self).validate()
  
          # Get scale
          lower_val = str(self._value).lower()
          if any(lower_val.endswith(i) for i in self.UNITS):
              scale = self.UNITS[lower_val[-1]]
              self._value = self._value[:-1]
          else:
              scale = 1
  
          # Get float value
          try:
              self._value = float(self._value)
          except (ValueError, TypeError), exc:
              raise FilterError("Bad numerical value %r in %r (%s)" % (self._value, self._condition, exc))
  
          # Scale to bytes
          self._value = self._value * scale
docs: Validate filter condition (template method).