<commit_before>#!/usr/bin/python

import mosquitto

#define what happens after connection
def on_connect(rc):
	print "Connected"

#On recipt of a message create a pynotification and show it
def on_message(msg):
	print((msg.topic, msg.payload))


#create a broker
mqttc = mosquitto.Mosquitto("python_sub")

#define the callbacks
mqttc.on_message = on_message
mqttc.on_connect = on_connect

#connect
mqttc.connect("192.168.1.109", 1883, 60, True)

#subscribe to topic test
mqttc.subscribe("rbpi", 2)

#keep connected to broker
while mqttc.loop() == 0:
	pass
<commit_msg>Added remote control of GPIO :]<commit_after>#!/usr/bin/python

import mosquitto
import RPi.GPIO as GPIO

#GPIO.cleanup(17)
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)

#Define '#' char
topic = chr(35)

#define what happens after connection
def on_connect(rc):
	print "Connected"

#On recipt of a message create a pynotification and show it
def on_message(msg):
	print((msg.topic, msg.payload))
	if msg.payload == 'on':
		GPIO.output(17, True)
	elif msg.payload == 'off':
		GPIO.output(17, False)

#create a broker
mqttc = mosquitto.Mosquitto("BROKER-PI")

#define the callbacks
mqttc.on_message = on_message
mqttc.on_connect = on_connect

#connect
mqttc.connect("192.168.1.109", 1883, 60, True)

#subscribe to all topic`s
mqttc.subscribe(topic, 2)

#keep connected to broker
while mqttc.loop() == 0:
	pass

{'fraction_non_alphanumeric': 0.12255257432922408, 'fraction_numerical': 0.03335750543872371, 'mean_word_length': 5.106194690265487, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3242697', 'n_tokens_mistral': 556, 'n_tokens_neox': 511, 'n_words': 143}