<commit_before>package goprovision

import (
	"github.com/op/go-logging"
	"github.com/opslabjpl/goamz.git/ec2"
	"io/ioutil"
	"net"
	"strings"
	"time"
)

var logger = logging.MustGetLogger("opslabcloud.goprovision")

type Provisioner struct {
	EC2 *ec2.EC2
}

type ProvOpts struct {
	Tags               []ec2.Tag
	TagAttachedVolumes bool
	SelfShutdown       bool
	KeepAliveProcesses []string // keep machine alive if these processes are running
	KeepAliveOpts      string   // e.g. "300 30"
	// 300 is the threshold (in seconds)
	// 30 is the frequency of the check (in seconds)
	StartUpScript string
	UserDataFile  string
}

func (pro *Provisioner) CreateInstances(ec2Opts ec2.RunInstancesOptions, provOpts ProvOpts) (instances []ec2.Instance, err error) {
	e := pro.EC2
	var instanceIds []string

	if provOpts.UserDataFile != "" {
		ec2Opts.UserData = PrepUserData(provOpts.UserDataFile, provOpts)<commit_msg>remove .git suffix from imports<commit_after>package goprovision

import (
	"github.com/op/go-logging"
	"github.com/opslabjpl/goamz/ec2"
	"io/ioutil"
	"net"
	"strings"
	"time"
)

var logger = logging.MustGetLogger("opslabcloud.goprovision")

type Provisioner struct {
	EC2 *ec2.EC2
}

type ProvOpts struct {
	Tags               []ec2.Tag
	TagAttachedVolumes bool
	SelfShutdown       bool
	KeepAliveProcesses []string // keep machine alive if these processes are running
	KeepAliveOpts      string   // e.g. "300 30"
	// 300 is the threshold (in seconds)
	// 30 is the frequency of the check (in seconds)
	StartUpScript string
	UserDataFile  string
}

func (pro *Provisioner) CreateInstances(ec2Opts ec2.RunInstancesOptions, provOpts ProvOpts) (instances []ec2.Instance, err error) {
	e := pro.EC2
	var instanceIds []string

	if provOpts.UserDataFile != "" {
		ec2Opts.UserData = PrepUserData(provOpts.UserDataFile, provOpts)
{'fraction_non_alphanumeric': 0.10032715376226826, 'fraction_numerical': 0.021810250817884406, 'mean_word_length': 3.97289972899729, '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': '2918237', 'n_tokens_mistral': 666, 'n_tokens_neox': 650, 'n_words': 165}