<commit_before>import RPi.GPIO as GPIO
import rospy
from std_msgs import Bool
from diagnostic_msgs import DiagnosticArray

CHANNEL =

def publish():
	leakPub = rospy.Publisher('Leak', Bool, queue_size=1)
	diagPub = rospy.Publisher('/diagnostic', DiagnosticArray)
	rospy.init_node('Leak')
	GPIO.setup(CHANNEL, GPIO.IN)
	freq = rospy.Rate(1)
	leak = Bool()
	pub = rospy.Publisher('/diagnostics', DiagnosticArray, queue_size=1)
	diag = DiagnosticArray()
	while not rospy.is_shutdown():
		levelData=0
		if (leak.data):
			diag.status[0].level=2
		diag.status = [DiagnosticStatus(name='Leak', message=str(leak.data), level=levelData]
		leak.data = GPIO.input(CHANNEL)
		leakPub.publish(leak)
		diagPub.publish(diag)
		freq.sleep()

if __name__ == '__main__':
	try:
		publish()
	except rospy.ROSInterruptException:
		pass
<commit_msg>tested and corrected Leak Sensor<commit_after>#!/usr/bin/env python
import RPi.GPIO as GPIO
import rospy
from std_msgs.msg import Bool
from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus

CHANNEL = 17

def publish():
	leakPub = rospy.Publisher('Leak', Bool, queue_size=1)
	diagPub = rospy.Publisher('/diagnostic', DiagnosticArray, queue_size=1)
	rospy.init_node('Leak')
	GPIO.setmode(GPIO.BCM)
	GPIO.setup(CHANNEL, GPIO.IN)
	freq = rospy.Rate(1)
	leak = Bool()
	pub = rospy.Publisher('/diagnostics', DiagnosticArray, queue_size=1)
	diag = DiagnosticArray()
	while not rospy.is_shutdown():
		levelData=0
		if (leak.data):
			levelData=2
		diag.status = [DiagnosticStatus(name='Leak', message=str(leak.data), level=levelData)]
		leak.data = GPIO.input(CHANNEL)
		leakPub.publish(leak)
		diagPub.publish(diag)
		freq.sleep()

if __name__ == '__main__':
	try:
		publish()
	except rospy.ROSInterruptException:
		pass

{'fraction_non_alphanumeric': 0.12941847206385404, 'fraction_numerical': 0.00798175598631699, 'mean_word_length': 5.428571428571429, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5313278', 'n_tokens_mistral': 698, 'n_tokens_neox': 642, 'n_words': 132}