<commit_before>import threading
import time

import RPi.GPIO as io


class PWMActuator(object):
    """
    Methods
    -------
    set(value)
        Use software PWM to output a value between 0 and 1

    Attributes
    ----------
    pin_number : int
    period : float
    value : float (0.0 - 1.0)

    """

    def __init__(self, pin_number, period=0.01, mode=io.BCM):
        """
        Parameters
        ----------

        pin_number : int
            number to use for this pin
        period : float
            period in seconds of the PWM cycle
        mode : int
            pin numbering scheme (see RPi.GPIO docs)

        """
        self.pin_number = pin_number  # Read Only
        self.period = period
        self.value = 0.0  # Read Only
        self.range(0, 1)
        self._thread = threading.Thread(target=self._worker)
        self._stopped = True

        io.setmode(mode)
        io.setup(pin_number, in_out)
        self._thread.start()

    def set(self, value):
        """<commit_msg>pwm bugfix<commit_after>import threading
import time

import RPi.GPIO as io


class PWMActuator(object):
    """
    Methods
    -------
    set(value)
        Use software PWM to output a value between 0 and 1

    Attributes
    ----------
    pin_number : int
    period : float
    value : float (0.0 - 1.0)

    """

    def __init__(self, pin_number, period=0.01, mode=io.BCM):
        """
        Parameters
        ----------

        pin_number : int
            number to use for this pin
        period : float
            period in seconds of the PWM cycle
        mode : int
            pin numbering scheme (see RPi.GPIO docs)

        """
        self.pin_number = pin_number  # Read Only
        self.period = period
        self.value = 0.0  # Read Only
        self.range = (0, 1)
        self._thread = threading.Thread(target=self._worker)
        self._stopped = True

        io.setmode(mode)
        io.setup(pin_number, io.OUT)
        self._thread.start()

    def set(self, value):
        """
{'fraction_non_alphanumeric': 0.11089303238469088, 'fraction_numerical': 0.012757605495583905, 'mean_word_length': 1.57124842370744, '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': '5200795', 'n_tokens_mistral': 635, 'n_tokens_neox': 598, 'n_words': 174}