<commit_before>package gofn

import (
	docker "github.com/fsouza/go-dockerclient"
	"github.com/nuveo/gofn/iaas"
	"github.com/nuveo/gofn/provision"
)

const dockerPort = ":2375"

// Run runs the designed image
func Run(buildOpts *provision.BuildOptions, volumeOpts *provision.VolumeOptions) (stdout string, err error) {
	client := provision.FnClient("")
	if buildOpts.Iaas != nil {
		var machine *iaas.Machine
		machine, err = buildOpts.Iaas.CreateMachine()
		defer buildOpts.Iaas.DeleteMachine(machine)
		if err != nil {
			return
		}
		client = provision.FnClient(machine.IP + dockerPort)
	}

	volume := ""
	if volumeOpts != nil {
		volume = provision.FnConfigVolume(volumeOpts)
	}

	img, err := provision.FnFindImage(client, buildOpts.ImageName)
	if err != nil && err != provision.ErrImageNotFound {
		return
	}

	var image string
	var container *docker.Container
<commit_msg>delete machine only if created<commit_after>package gofn

import (
	docker "github.com/fsouza/go-dockerclient"
	"github.com/nuveo/gofn/iaas"
	"github.com/nuveo/gofn/provision"
)

const dockerPort = ":2375"

// Run runs the designed image
func Run(buildOpts *provision.BuildOptions, volumeOpts *provision.VolumeOptions) (stdout string, err error) {
	client := provision.FnClient("")
	if buildOpts.Iaas != nil {
		var machine *iaas.Machine
		machine, err = buildOpts.Iaas.CreateMachine()
		if err != nil {
			return
		}
		defer buildOpts.Iaas.DeleteMachine(machine)
		client = provision.FnClient(machine.IP + dockerPort)
	}

	volume := ""
	if volumeOpts != nil {
		volume = provision.FnConfigVolume(volumeOpts)
	}

	img, err := provision.FnFindImage(client, buildOpts.ImageName)
	if err != nil && err != provision.ErrImageNotFound {
		return
	}

	var image string
	var container *docker.Container

{'fraction_non_alphanumeric': 0.11844331641285956, 'fraction_numerical': 0.0045121263395375075, 'mean_word_length': 4.39209726443769, 'pattern_counts': {'":': 2, '<': 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': '3117269', 'n_tokens_mistral': 637, 'n_tokens_neox': 612, 'n_words': 136}