<commit_before>import os
from dotenv import load_dotenv
from os.path import *
dotenv_path = join(dirname(__file__), '..', '.env')
load_dotenv(dotenv_path)

import pygame
from time import sleep

import pusher

pusher_client = pusher.Pusher(
  app_id=os.environ['PUSHER_APP_ID'],
  key=os.environ['PUSHER_APP_KEY'],
  secret=os.environ['PUSHER_SECRET_KEY'],
  cluster=os.environ['PUSHER_CLUSTER'],
  ssl=True
)


class Button:

    def __init__(self, name):
        self.name = name
        self.last = False
        self.count = 0

    def update(self, state):

        state = bool(state)

        if self.last != state:
            print ">>", self.name, state

            if state:
                self.count = self.count + 1
                pusher_client.trigger(self.name, 'press', {'ref': self.count})
            else:
                pusher_client.trigger(self.name, 'release', {'ref': self.count})

            self.last = state



button = Button('button')<commit_msg>Send the current time with payload<commit_after>import os
from dotenv import load_dotenv
from os.path import *
dotenv_path = join(dirname(__file__), '..', '.env')
load_dotenv(dotenv_path)

import pygame
from time import sleep, time

import pusher

pusher_client = pusher.Pusher(
  app_id=os.environ['PUSHER_APP_ID'],
  key=os.environ['PUSHER_APP_KEY'],
  secret=os.environ['PUSHER_SECRET_KEY'],
  cluster=os.environ['PUSHER_CLUSTER'],
  ssl=True
)


class Button:

    def __init__(self, name):
        self.name = name
        self.last = False
        self.count = 0

    def update(self, state):

        state = bool(state)

        if self.last != state:
            print ">>", self.name, state

            if state:
                self.count = self.count + 1
                pusher_client.trigger(self.name, 'press', {'id': self.count, 'time': time()})
            else:
                pusher_client.trigger(self.name, 'release', {'id': self.count, 'time': time()})

            self.last = state



button = Button('button')
{'fraction_non_alphanumeric': 0.12965722801788376, 'fraction_numerical': 0.001987083954297069, 'mean_word_length': 2.6157989228007184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5772426', 'n_tokens_mistral': 676, 'n_tokens_neox': 661, 'n_words': 145}