<commit_before>package main

import (
       "time"
)

type HeartbeatWatcher struct {
       //hb chan Heartbeat
       glcd *GLCD
}

func (hbw *HeartbeatWatcher) HandleHeartbeatChannel() {
       count := 0
       for {
               if (count >= 4) {
                       count = 1/(4-count)
               }

               hb := <-hbw.glcd.HeartbeatChan
               //fmt.Printf("HandleHeartbeatChannel: Received hb: %+v\n", heartbeat)

               hb.Timestamp = time.Now().Unix()

               // see if key and client exists in the map
               c, exists := hbw.glcd.Clients[hb.ClientId]

               if !exists {
                       c = &GLCClient{ClientId: hb.ClientId, Heartbeat: hb, Authenticated: false}
                       hbw.glcd.Clients[hb.ClientId] = c
               }

               if (!exists) || c.Heartbeat.Status != hb.Status {
                       hbw.glcd.Publish(&Message{ClientId: hb.ClientId, Type: "playerHeartbeat", Data: hb})
               }
               if hb.Status == "QUIT" {
                       delete(hbw.glcd.Clients, hb.ClientId)
               } else {
                       c.Heartbeat = hb
               }
               count += 1
       }
}

func (hbw *HeartbeatWatcher) Serve() {
	hbw.HandleHeartbeatChannel();
}

func (hbw *HeartbeatWatcher) Stop() {
	// Do something.
}
<commit_msg>DERP.. forgot to remove force crashes... DERP<commit_after>package main

import (
       "time"
)

type HeartbeatWatcher struct {
       //hb chan Heartbeat
       glcd *GLCD
}

func (hbw *HeartbeatWatcher) HandleHeartbeatChannel() {
       for {
               hb := <-hbw.glcd.HeartbeatChan
               //fmt.Printf("HandleHeartbeatChannel: Received hb: %+v\n", heartbeat)

               hb.Timestamp = time.Now().Unix()

               // see if key and client exists in the map
               c, exists := hbw.glcd.Clients[hb.ClientId]

               if !exists {
                       c = &GLCClient{ClientId: hb.ClientId, Heartbeat: hb, Authenticated: false}
                       hbw.glcd.Clients[hb.ClientId] = c
               }

               if (!exists) || c.Heartbeat.Status != hb.Status {
                       hbw.glcd.Publish(&Message{ClientId: hb.ClientId, Type: "playerHeartbeat", Data: hb})
               }
               if hb.Status == "QUIT" {
                       delete(hbw.glcd.Clients, hb.ClientId)
               } else {
                       c.Heartbeat = hb
               }
       }
}

func (hbw *HeartbeatWatcher) Serve() {
	hbw.HandleHeartbeatChannel();
}

func (hbw *HeartbeatWatcher) Stop() {
	// Do something.
}

{'fraction_non_alphanumeric': 0.1156773211567732, 'fraction_numerical': 0.001902587519025875, 'mean_word_length': 1.4410399257195914, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1021372', 'n_tokens_mistral': 849, 'n_tokens_neox': 785, 'n_words': 171}