<commit_before>
import RPi.GPIO as GPIO


class Led(object):

    """RGB Led control module."""

    color = (0, 0, 0)
    __gpio_module__ = GPIO

    def __init__(self, red_pin, green_pin, blue_pin):
        """Module constructor."""
        self.gpio = self.__gpio_module__
        self.red_pin = red_pin
        self.green_pin = green_pin
        self.blue_pin = blue_pin

        self.red = self.gpio.PWM(red_pin, 100)
        self.green = self.gpio.PWM(green_pin, 100)
        self.blue = self.gpio.PWM(blue_pin, 100)

        self.red.start(0)
        self.green.start(0)
        self.blue.start(0)

    def set_color(self, color):
        """Set RGB color.

        color - tuple: (R, G, B)
        R, G, B: 0-255
        """
        self.color = color

    def on(self):
        """Turn led on."""
        self.red.ChangeDutyCycle(self.prepare_data(self.reverse(self.color[0])))<commit_msg>running on RPI<commit_after>
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)

class Led(object):

    """RGB Led control module."""

    color = (0, 0, 0)
    __gpio_module__ = GPIO

    def __init__(self, red_pin, green_pin, blue_pin):
        """Module constructor."""
        self.gpio = self.__gpio_module__
        self.red_pin = red_pin
        self.green_pin = green_pin
        self.blue_pin = blue_pin

	self.gpio.setup(red_pin, self.gpio.OUT)
	self.gpio.setup(green_pin, self.gpio.OUT)
	self.gpio.setup(blue_pin, self.gpio.OUT)

        self.red = self.gpio.PWM(red_pin, 100)
        self.green = self.gpio.PWM(green_pin, 100)
        self.blue = self.gpio.PWM(blue_pin, 100)

        self.red.start(0)
        self.green.start(0)
        self.blue.start(0)

    def set_color(self, color):
        """Set RGB color.

        color - tuple: (R, G, B)
        R, G, B: 0-255
        """
        self.color = color

    def on(self):
        """Turn led on."""
        self.red.ChangeDutyCycle(self.prepare_data(self.reverse(self.color[0])))
{'fraction_non_alphanumeric': 0.13713405238828968, 'fraction_numerical': 0.02054442732408834, 'mean_word_length': 2.2145214521452146, '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': '3711750', 'n_tokens_mistral': 726, 'n_tokens_neox': 677, 'n_words': 142}