code: def clean(self, value):
          
  
          if isinstance(value, numbers.Number):
              return value
          elif isinstance(value, six.string_types):
              try:
                  value = float(value)
                  return int(value) if value.is_integer() else value
              except ValueError:
                  raise ParameterNotValidError
  
          raise ParameterNotValidError
docs: Cleans and returns the given value, or raises a ParameterNotValidError exception