<commit_before>from .module import Module, interact


class Color(Module):
    def __init__(self, id, alias, robot):
        Module.__init__(self, 'Color', id, alias, robot)
        self.color = (0, 0, 0)
        self.time = 0.0

    @property
    def color(self):
        return self._value

    @color.setter
    def color(self, new_color):
        new_color = [int(min(max(c, 0), 255)) for c in new_color]
        self._value = new_color
        self._push_value('color', new_color)

    @property
    def time(self):
        return self._time

    @time.setter
    def time(self, new_time):
        self._time = new_time
        self._push_value('time', new_time)

    def _update(self, new_state):
        Module._update(self, new_state)

    def control(self):
        def change_color(red, green, blue):
            self.color = (red, green, blue)

        return interact(change_color,
                        red=(0, 255, 1),
                        green=(0, 255, 1),
                        blue=(0, 255, 1))<commit_msg>manage binaries for color<commit_after>from .module import Module, interact
import numpy as np


class Color(Module):
    def __init__(self, id, alias, robot):
        Module.__init__(self, 'Color', id, alias, robot)

    @property
    def color(self):
        return self._value

    @color.setter
    def color(self, new_color):
        new_color = [int(min(max(c, 0), 255)) for c in new_color]
        if len(new_color) > 3 :
            self._value = new_color
            self._push_value('color', len(new_color))
            self._push_data(np.array(new_color, dtype=np.uint8))
        else :
            self._value = new_color
            self._push_value('color', new_color)
    @property
    def time(self):
        return self._time

    @time.setter
    def time(self, new_time):
        self._time = new_time
        self._push_value('time', new_time)

    @property
    def size(self):
        return self._size

    @time.setter
    def size(self, new_size):
        self._size = new_size
        self._push_value('parameters', new_size)

    def _update(self, new_state):
        Module._update(self, new_state)

    def control(self):
        def change_color(red, green, blue):
            self.color = (red, green, blue)

        return interact(change_color,
                        red=(0, 255, 1),
                        green=(0, 255, 1),
                        blue=(0, 255, 1))
{'fraction_non_alphanumeric': 0.11498973305954825, 'fraction_numerical': 0.018480492813141684, 'mean_word_length': 2.0185873605947955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '886322', 'n_tokens_mistral': 796, 'n_tokens_neox': 734, 'n_words': 189}