code: def validate_quantity(self, value):
          
          if not isinstance(value, pq.quantity.Quantity):
              self._error('%s' % value, "Must be a Python quantity.")
docs: Validate that the value is of the `Quantity` type.