def checkThreshold(self, key, alias, r):
		failure = ''
		invert = False
		start = 0
		end = 'infinity'
		if r.startswith('@'):
			invert = True
			r = r[1:]
		vals = r.split(':')
		if len(vals) == 1:
			end = vals[0]
		if len(vals) == 2:
			start = vals[0]
			if vals[1] != '':
				end = vals[1]
		if(start == '~'):
			if (invert and self.helper.lte(key, end)):
				failure += " Value for key %s was less than or equal to %s." % (alias, end)
			elif (not invert and self.helper.gt(key, end)):
				failure += " Value for key %s was greater than %s." % (alias, end)
		elif(end == 'infinity'):
			if (invert and self.helper.gte(key, start)):
				failure += (alias, start) % " Value for key %s was greater than or equal to %s."
			elif (not invert and self.helper.lt(key, start)):
				failure += " Value for key %s was less than %s." % (alias, start)
		else:
			if (invert and self.helper.gte(key, start) and self.helper.lte(key, end)):
				failure += " Value for key %s was inside the range %s:%s." % (alias, start, end)
			elif (not invert and (self.helper.lt(key, start) or self.helper.gt(key, end))):
				failure += " Value for key %s was outside the range %s:%s." % (alias, start, end)
		return failure
dataset/ETHPy150Open drewkerrigan/nagios-http-json/check_http_json.py/JsonRuleProcessor.checkThreshold/swapped operands of `%`