<commit_before>package harmonyclient

import (
	"bytes"
	"crypto/tls"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"strings"

	"github.com/univedo/api2go/jsonapi"
)

func init() {

}

// Client the main Harmony Client
type Client struct {
	// The client configuration
	Config Config
	_data  string
}

// NewHarmonyClient returns a new Harmony Client instance
func NewHarmonyClient(conf Config) (c *Client, err error) {
	c = &Client{
		Config: conf,
		_data:  "chicken",
	}

	err = nil
	return
}

// Containers gets a list of all the containers
func (C *Client) Containers() (*[]Container, error) {
	m := map[string]string{}

	response := new(map[string]interface{})
	if err := C.get("/containers", m, response); err != nil {
		return nil, err
	}

	if err := (*response)["errors"]; err != nil {
		err := err.([]interface{})
		e := err[0].(map[string]interface{})

		return nil, fmt.Errorf("[%d] %s", int(e["status"].(float64)), e["title"])
	}

	// fmt.Printf("\n\nHERE: %+v\n\n\n", response)
	var containers []Container
	err := jsonapi.Unmarshal(*response, &containers)

	return &containers, err
}

// ContainersAdd will create a new Container resource
func (C *Client) ContainersAdd(c *Container) (*Container, error) {<commit_msg>Client: added Machines<commit_after>package harmonyclient

import (
	"bytes"
	"crypto/tls"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"strings"

	"github.com/univedo/api2go/jsonapi"
)

func init() {

}

// Client the main Harmony Client
type Client struct {
	// The client configuration
	Config Config
	_data  string
}

// NewHarmonyClient returns a new Harmony Client instance
func NewHarmonyClient(conf Config) (c *Client, err error) {
	c = &Client{
		Config: conf,
		_data:  "chicken",
	}

	err = nil
	return
}

// Containers gets a list of all the containers
func (C *Client) Containers() (*[]Container, error) {
	m := map[string]string{}

	response := new(map[string]interface{})
	if err := C.get("/containers", m, response); err != nil {
		return nil, err
	}

	if err := (*response)["errors"]; err != nil {
		err := err.([]interface{})
		e := err[0].(map[string]interface{})

		return nil, fmt.Errorf("[%d] %s", int(e["status"].(float64)), e["title"])
	}

	// fmt.Printf("\n\nHERE: %+v\n\n\n", response)
	var containers []Container
	err := jsonapi.Unmarshal(*response, &containers)

	return &containers, err
}

// Machines gets a list of all the machines
func (C *Client) Machines() (*[]Machine, error) {
	m := map[string]string{}

	response := new(map[string]interface{})
	if err := C.get("/machines", m, response); err != nil {
		return nil, err
	}

	if err := (*response)["errors"]; err != nil {
		err := err.([]interface{})
		e := err[0].(map[string]interface{})

		return nil, fmt.Errorf("[%d] %s", int(e["status"].(float64)), e["title"])
	}

	// fmt.Printf("\n\nHERE: %+v\n\n\n", response)
	var machines []Machine
	err := jsonapi.Unmarshal(*response, &machines)

	return &machines, err
}

// ContainersAdd will create a new Container resource
func (C *Client) ContainersAdd(c *Container) (*Container, error) {
{'fraction_non_alphanumeric': 0.17788617886178862, 'fraction_numerical': 0.0035772357723577236, 'mean_word_length': 4.1610738255033555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '867211', 'n_tokens_mistral': 1127, 'n_tokens_neox': 1091, 'n_words': 299}