<commit_before>package main

import (
    "os"
    "fmt"
    "encoding/json"
    "github.com/toke/golang-callmon"
)


func handleMessages(msgchan <-chan fritzbox.FbEvent){
  for {
      ev := <- msgchan

      jsonm,_ := json.Marshal(&ev)
      fmt.Printf("Some JSON: %s\n", jsonm)

      if ev.EventName == fritzbox.CALL {
        fmt.Printf("%s Event: %s->%s\n", ev.EventName, ev.Source, ev.Destination)
      } else if ev.EventName == fritzbox.RING {
        fmt.Printf("%s Event: %s->%s\n", ev.EventName, ev.Source, ev.Destination)
      } else {
          fmt.Printf("! %s\n", ev)
      }
  }
}

func mainloop(host string) {
  c := new(fritzbox.CallmonHandler).Connect(host)

  defer c.Close()

  if c.Connected {
    recv := make(chan fritzbox.FbEvent)
    go handleMessages(recv)
 
    // Inject a test message
    f := c.Parse("06.08.14 14:52:26;CALL;1;10;50000001;012344567;SIP1;")
    recv <- f

    c.Loop(recv)
  }
}

func main() {
  arg := os.Args

  host := "fritz.box"
  if (len(arg) > 1 && arg[1] != "") {
    host = arg[1]
  }

  mainloop(host)
  fmt.Println("NEVER EVER GONNA GIVE YOU UP")
}
<commit_msg>fixed imports<commit_after>package main

import (
    "os"
    "fmt"
    "encoding/json"
    "github.com/toke/golang-callmon/fritzbox"
)


func handleMessages(msgchan <-chan fritzbox.FbEvent){
  for {
      ev := <- msgchan

      jsonm,_ := json.Marshal(&ev)
      fmt.Printf("Some JSON: %s\n", jsonm)

      if ev.EventName == fritzbox.CALL {
        fmt.Printf("%s Event: %s->%s\n", ev.EventName, ev.Source, ev.Destination)
      } else if ev.EventName == fritzbox.RING {
        fmt.Printf("%s Event: %s->%s\n", ev.EventName, ev.Source, ev.Destination)
      } else {
          fmt.Printf("! %s\n", ev)
      }
  }
}

func mainloop(host string) {
  c := new(fritzbox.CallmonHandler).Connect(host)

  defer c.Close()

  if c.Connected {
    recv := make(chan fritzbox.FbEvent)
    go handleMessages(recv)
 
    // Inject a test message
    f := c.Parse("06.08.14 14:52:26;CALL;1;10;50000001;012344567;SIP1;")
    recv <- f

    c.Loop(recv)
  }
}

func main() {
  arg := os.Args

  host := "fritz.box"
  if (len(arg) > 1 && arg[1] != "") {
    host = arg[1]
  }

  mainloop(host)
  fmt.Println("NEVER EVER GONNA GIVE YOU UP")
}

{'fraction_non_alphanumeric': 0.17177097203728361, 'fraction_numerical': 0.03195739014647137, 'mean_word_length': 2.5496062992125985, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3648889', 'n_tokens_mistral': 952, 'n_tokens_neox': 889, 'n_words': 175}