Clean

		Cleans and returns the new value

		Arguments:
			value {mixed} -- The value to clean

		Returns:
			mixed

def clean(self, value):
		"""Clean

		Cleans and returns the new value

		Arguments:
			value {mixed} -- The value to clean

		Returns:
			mixed
		"""

		# If the value is None and it's optional, return as is
		if value is None and self._optional:
			return None

		# If it's an ANY, there is no reasonable expectation that we know what
		#	the value should be, so we return it as is
		if self._type == 'any':
			pass

		# Else if it's a basic string type
		elif self._type in ['base64', 'ip', 'string', 'uuid']:

			# And not already a string
			if not isinstance(value, basestring):
				value = str(value)

		# Else if it's a BOOL just check if the value flags as positive
		elif self._type == 'bool':

			# If it's specifically a string, it needs to match a specific
			#	pattern to be true
			if isinstance(value, basestring):
				value = (value in ('true', 'True', 'TRUE', 't', 'T', 'yes', 'Yes', 'YES', 'y', 'Y', 'x', '1') and True or False);

			# Else
			else:
				value = (value and True or False)

		# Else if it's a date type
		elif self._type == 'date':

			# If it's a python type, use strftime on it
			if isinstance(value, (datetime.date, datetime.datetime)):
				value = value.strftime('%Y-%m-%d')

			# Else if it's already a string
			elif isinstance(value, basestring):
				pass

			# Else convert it to a string
			else:
				value = str(value)

		# Else if it's a datetime type
		elif self._type == 'datetime':

			# If it's a python type, use strftime on it
			if isinstance(value, datetime.datetime):
				value = value.strftime('%Y-%m-%d %H:%M:%S')
			elif isinstance(value, datetime.date):
				value = '%s 00:00:00' % value.strftime('%Y-%m-%d')

			# Else if it's already a string
			elif isinstance(value, basestring):
				pass

			# Else convert it to a string
			else:
				value = str(value)

		# Else if it's a decimal
		elif self._type == 'decimal':

			# If it's not a decimal
			if not isinstance(value, Decimal):
				value = Decimal(value)

			# Convert it to a string
			value = '{0:f}'.format(value)

		# Else if it's a float
		elif self._type == 'float':
			value = float(value)

		# Else if it's an int type
		elif self._type in ['int', 'timestamp', 'uint']:

			# If the value is a string
			if isinstance(value, basestring):

				# If it starts with 0
				if value[0] == '0' and len(value) > 1:

					# If it's followed by X or x, it's hex
					if value[1] in ['x', 'X'] and len(value) > 2:
						value = int(value, 16)

					# Else it's octal
					else:
						value = int(value, 8)

				# Else it's base 10
				else:
					value = int(value)

			# Else if it's not an int already
			elif not isinstance(value, int):
				value = int(value)

		# Else if it's a JSON type
		elif self._type == 'json':

			# If it's already a string
			if isinstance(value, basestring):
				pass

			# Else, encode it
			else:
				value = JSON.encode(value)

		# Else if it's an md5 type
		elif self._type == 'md5':

			# If it's a python type, get the hexadecimal digest
			if isinstance(value, _MD5_TYPE):
				value = value.hexdigest()

			# Else if it's a string
			elif isinstance(value, basestring):
				pass

			# Else, try to convert it to a string
			else:
				value = str(value)

		# Else if it's a price type
		elif self._type == 'price':

			# If it's not already a Decimal
			if not isinstance(value, Decimal):
				value = Decimal(value)

			# Make sure its got 2 decimal places
			value = "{0:f}".format(value.quantize(Decimal('1.00')))

		# Else if it's a time type
		elif self._type == 'time':

			# If it's a python type, use strftime on it
			if isinstance(value, (datetime.time, datetime.datetime)):
				value = value.strftime('%H:%M:%S')

			# Else if it's already a string
			elif isinstance(value, basestring):
				pass

			# Else convert it to a string
			else:
				value = str(value)

		# Else we probably forgot to add a new type
		else:
			raise Exception('%s has not been added to .clean()' % self._type)

		# Return the cleaned value
		return value