<commit_before>package google

import (
	"strings"

	"code.google.com/p/google-api-go-client/compute/v1"
)

// readImage finds the image with the given name.
func readImage(c *Config, name string) (*compute.Image, error) {
	// First, always try ourselves first.
	image, err := c.clientCompute.Images.Get(c.Project, name).Do()
	if err == nil && image != nil && image.SelfLink != "" {
		return image, nil
	}

	// This is a map of names to the project name where a public image is
	// hosted. GCE doesn't have an API to simply look up an image without
	// a project so we do this jank thing.
	imageMap := map[string]string{
		"centos":   "centos-cloud",
		"coreos":   "coreos-cloud",
		"debian":   "debian-cloud",
		"opensuse": "opensuse-cloud",
		"rhel":     "rhel-cloud",
		"sles":     "suse-cloud",
	}

	// If we match a lookup for an alternate project, then try that next.
	// If not, we return the error.
	var project string
	for k, v := range imageMap {<commit_msg>provider/google: Add Ubuntu images<commit_after>package google

import (
	"strings"

	"code.google.com/p/google-api-go-client/compute/v1"
)

// readImage finds the image with the given name.
func readImage(c *Config, name string) (*compute.Image, error) {
	// First, always try ourselves first.
	image, err := c.clientCompute.Images.Get(c.Project, name).Do()
	if err == nil && image != nil && image.SelfLink != "" {
		return image, nil
	}

	// This is a map of names to the project name where a public image is
	// hosted. GCE doesn't have an API to simply look up an image without
	// a project so we do this jank thing.
	imageMap := map[string]string{
		"centos":   "centos-cloud",
		"coreos":   "coreos-cloud",
		"debian":   "debian-cloud",
		"opensuse": "opensuse-cloud",
		"rhel":     "rhel-cloud",
		"sles":     "suse-cloud",
		"ubuntu":   "ubuntu-os-cloud",
	}

	// If we match a lookup for an alternate project, then try that next.
	// If not, we return the error.
	var project string
	for k, v := range imageMap {
{'fraction_non_alphanumeric': 0.13869346733668342, 'fraction_numerical': 0.0010050251256281408, 'mean_word_length': 3.26338329764454, 'pattern_counts': {'":': 13, '<': 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': '3641986', 'n_tokens_mistral': 698, 'n_tokens_neox': 665, 'n_words': 235}