<commit_before>package main

import (
	"flag"
	"fmt"
	"koding/newkite/kite"
	"koding/newkite/protocol"
)

var port = flag.String("port", "", "port to bind itself")

func main() {
	flag.Parse()

	options := &protocol.Options{
		Kitename:    "mathworker",
		Version:     "1",
		Port:        *port,
		Region:      "localhost",
		Environment: "development",
		PublicIP:    "127.0.0.1",
	}

	k := kite.New(options)

	k.HandleFunc("square", Square)

	k.Run()
}

func Square(r *kite.Request) (interface{}, error) {
	a, err := r.Args.Float64()
	if err != nil {
		return nil, err
	}

	result := a * a

	fmt.Printf("Kite call, sending result '%s' back\n", result)

	// Print a log on remote Kite.
	r.RemoteKite.Go("log", fmt.Sprintf("You have requested square of: %f", a))

	return result, nil
}<commit_msg>kite: fix log in example<commit_after>package main

import (
	"flag"
	"fmt"
	"koding/newkite/kite"
	"koding/newkite/protocol"
)

var port = flag.String("port", "", "port to bind itself")

func main() {
	flag.Parse()

	options := &protocol.Options{
		Kitename:    "mathworker",
		Version:     "1",
		Port:        *port,
		Region:      "localhost",
		Environment: "development",
		PublicIP:    "127.0.0.1",
	}

	k := kite.New(options)

	k.HandleFunc("square", Square)

	k.Run()
}

func Square(r *kite.Request) (interface{}, error) {
	a, err := r.Args.Float64()
	if err != nil {
		return nil, err
	}

	result := a * a

	fmt.Printf("Kite call, sending result %.0f back\n", result)

	// Print a log on remote Kite.
	r.RemoteKite.Go("log", fmt.Sprintf("You have requested square of: %f", a))

	return result, nil
}
{'fraction_non_alphanumeric': 0.17196261682242991, 'fraction_numerical': 0.011838006230529595, 'mean_word_length': 3.2941176470588234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3390646', 'n_tokens_mistral': 645, 'n_tokens_neox': 607, 'n_words': 158}