<commit_before>package main

import (
	"bufio"
	"fmt"
	"io"
	"os"

	"github.com/docker/machine/libmachine"
	"github.com/docker/machine/libmachine/drivers/virtualbox"
	"github.com/docker/machine/libmachine/log"
)

type FancyWriter struct {
	bufWriter *bufio.Writer
}

func NewFancyWriter(w io.Writer) (*FancyWriter, error) {
	f := &FancyWriter{bufio.NewWriter(w)}

	_, err := f.bufWriter.WriteString("=> ")
	if err != nil {
		return nil, err
	}

	return f, nil
}

func (f FancyWriter) Write(p []byte) (int, error) {
	n := 0
	for _, b := range p {
		if err := f.bufWriter.WriteByte(b); err != nil {
			return n, err
		}
		if b == '\n' {
			if err := f.bufWriter.Flush(); err != nil {
				return n, err
			}
			n, err := f.bufWriter.WriteString("=> ")
			if err != nil {
				return n, err
			}
		}
		n++
	}

	return n, nil
}

func bail() {
	fmt.Println("Improper usage.  Usage: moby up")
	os.Exit(1)
}

func main() {
	libmachine.SetDebug(true)

	fwout, err := NewFancyWriter(os.Stdout)
	if err != nil {
		bail()
	}
	log.SetOutWriter(fwout)

	fwerr, err := NewFancyWriter(os.Stderr)
	if err != nil {
		bail()
	}
	log.SetErrWriter(fwerr)

	store := libmachine.GetDefaultStore()
	store.Path = "/tmp/moby"

	driver := virtualbox.NewDriver("mobydick", "/tmp/moby")

	h, err := store.NewHost(driver)
	if err != nil {
		log.Fatal(err)
	}

	if len(os.Args) != 2 {
		bail()
	}

	if os.Args[1] == "up" {
		if err := libmachine.Create(store, h); err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	} else {
		bail()
	}
}<commit_msg>YAML stuffs<commit_after>package main

import (
	"bufio"
	"fmt"
	"io"
	"io/ioutil"
	"os"

	"github.com/davecgh/go-spew/spew"
	"github.com/docker/machine/libmachine"
	"github.com/docker/machine/libmachine/drivers/virtualbox"
	"github.com/docker/machine/libmachine/host"
	"github.com/docker/machine/libmachine/log"
	"gopkg.in/yaml.v2"
)

type FancyWriter struct {
	bufWriter *bufio.Writer
}

func NewFancyWriter(w io.Writer) (*FancyWriter, error) {
	f := &FancyWriter{bufio.NewWriter(w)}

	_, err := f.bufWriter.WriteString("=> ")
	if err != nil {
		return nil, err
	}

	return f, nil
}

func (f FancyWriter) Write(p []byte) (int, error) {
	n := 0
	for _, b := range p {
		if err := f.bufWriter.WriteByte(b); err != nil {
			return n, err
		}
		if b == '\n' {
			if err := f.bufWriter.Flush(); err != nil {
				return n, err
			}
			n, err := f.bufWriter.WriteString("=> ")
			if err != nil {
				return n, err
			}
		}
		n++
	}

	return n, nil
}

func bail() {
	fmt.Println("Improper usage.  Usage: moby up")
	os.Exit(1)
}

func main() {
	libmachine.SetDebug(true)

	fwout, err := NewFancyWriter(os.Stdout)
	if err != nil {
		bail()
	}
	log.SetOutWriter(fwout)

	fwerr, err := NewFancyWriter(os.Stderr)
	if err != nil {
		bail()
	}
	log.SetErrWriter(fwerr)

	store := libmachine.GetDefaultStore()
	store.Path = "/tmp/moby"

	driver := virtualbox.NewDriver("mobydick", "/tmp/moby")

	h, err := store.NewHost(driver)
	if err != nil {
		log.Fatal(err)
	}

	if len(os.Args) != 2 {
		bail()
	}

	if os.Args[1] == "up" {
		data, err := ioutil.ReadFile("moby.yml")
		if err != nil {
			fmt.Println(err)
			os.Exit(1)
		}

		unmarshalHost := host.Host{}

		if err := yaml.Unmarshal(data, &unmarshalHost); err != nil {
			fmt.Println(err)
			os.Exit(1)
		}

		spew.Dump(unmarshalHost)

		h.HostOptions = unmarshalHost.HostOptions

		spew.Dump(h)

		os.Exit(0)

		if err := libmachine.Create(store, h); err != nil {
			fmt.Println(err)
			os.Exit(1)
		}
	} else {
		bail()
	}
}
{'fraction_non_alphanumeric': 0.17451205510907003, 'fraction_numerical': 0.004018369690011481, 'mean_word_length': 3.1438763376932224, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2505185', 'n_tokens_mistral': 1601, 'n_tokens_neox': 1455, 'n_words': 300}