<commit_before>package api

import (
	"errors"

	log "github.com/Sirupsen/logrus"
	"github.com/kolo/xmlrpc"
	"github.com/megamsys/libgo/cmd"
)

const (
	ENDPOINT       = "endpoint"
	USERID         = "userid"
	TEMPLATE       = "template"
	PASSWORD       = "password"
)

var ErrConnRefused = errors.New("connection refused")


/*
 * RPC Client and secret key
 */
type Rpc struct {
	RPCClient xmlrpc.Client
	Key       string
}

/**
 *
 * Creates an RPCClient with endpoint and returns it
 *
 **/
func NewRPCClient(endpoint string, username string, password string) (*Rpc, error) {
	log.Debugf(cmd.Colorfy("\n> [one-go]", "white", "", "bold") + cmd.Colorfy(" client", "green", "", ""))

	RPCclient, err := xmlrpc.NewClient(endpoint, nil)

	if err != nil {
		//TO-DO: trap and send connRefused error.
		return nil, err
	}
	log.Debugf(cmd.Colorfy("\n> connected", "purple", "", "bold")+" %s\n", endpoint)

	return &Rpc{
		RPCClient: *RPCclient,
		Key:       username + ":" + password}, nil
}

/**
 *
 * Do an RPC Call
 *
 **/
func (c *Rpc) Call(RPC xmlrpc.Client, command string, args []interface{}) ([]interface{}, error) {
	log.Debugf(cmd.Colorfy("\n> request", "blue", "", "bold")+" %s", command)
	log.Debugf(cmd.Colorfy("\n> args   ", "cyan", "", "bold")+" %v\n", args)

	result := []interface{}{}
	err := RPC.Call(command, args, &result)
	if err != nil {
		return nil, err
	}
	log.Debugf(cmd.Colorfy("\n> response ", "cyan", "", "bold")+" %v", result)

	return result, nil
}
<commit_msg>commented the response debug line<commit_after>package api

import (
	"errors"

	log "github.com/Sirupsen/logrus"
	"github.com/kolo/xmlrpc"
	"github.com/megamsys/libgo/cmd"
)

const (
	ENDPOINT       = "endpoint"
	USERID         = "userid"
	TEMPLATE       = "template"
	PASSWORD       = "password"
)

var ErrConnRefused = errors.New("connection refused")


/*
 * RPC Client and secret key
 */
type Rpc struct {
	RPCClient xmlrpc.Client
	Key       string
}

/**
 *
 * Creates an RPCClient with endpoint and returns it
 *
 **/
func NewRPCClient(endpoint string, username string, password string) (*Rpc, error) {
	log.Debugf(cmd.Colorfy("\n> [one-go]", "white", "", "bold") + cmd.Colorfy(" client", "green", "", ""))

	RPCclient, err := xmlrpc.NewClient(endpoint, nil)

	if err != nil {
		//TO-DO: trap and send connRefused error.
		return nil, err
	}
	log.Debugf(cmd.Colorfy("\n> connected", "purple", "", "bold")+" %s\n", endpoint)

	return &Rpc{
		RPCClient: *RPCclient,
		Key:       username + ":" + password}, nil
}

/**
 *
 * Do an RPC Call
 *
 **/
func (c *Rpc) Call(RPC xmlrpc.Client, command string, args []interface{}) ([]interface{}, error) {
	log.Debugf(cmd.Colorfy("\n> request", "blue", "", "bold")+" %s", command)
	log.Debugf(cmd.Colorfy("\n> args   ", "cyan", "", "bold")+" %v\n", args)

	result := []interface{}{}
	err := RPC.Call(command, args, &result)
	if err != nil {
		return nil, err
	}
	//log.Debugf(cmd.Colorfy("\n> response ", "cyan", "", "bold")+" %v", result)

	return result, nil
}

{'fraction_non_alphanumeric': 0.19238476953907815, 'fraction_numerical': 0.0, 'mean_word_length': 3.544764795144158, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '3563149', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1088, 'n_words': 274}