<commit_before>// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// The scaleway command creates ARM servers on Scaleway.com.
package main

import (
	"bytes"
	"crypto/hmac"
	"crypto/md5"
	"encoding/json"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"path/filepath"
	"sort"
	"strings"
	"time"

	"go4.org/types"
	revtype "golang.org/x/build/types"
)

var (
	tokenDir    = flag.String("token-dir", filepath.Join(os.Getenv("HOME"), "keys"), "directory to read gobuilder-staging.key, gobuilder-master.key and go-scaleway.token from.")
	token       = flag.String("token", "", "API token. If empty, the file is read from $(token-dir)/go-scaleway.token. Googlers on the Go team can get the value from http://go/golang-scaleway-token")
	org         = flag.String("org", "1f34701d-668b-441b-bf08-0b13544e99de", "Organization ID (default is <EMAIL>'s account)")
	image       = flag.String("image", "e488d5e3-d278-47a7-8f7d-1154e1f61dc9", "Disk image ID; default is the snapshot we made last")
	num         = flag.Int("n", 0, "Number of servers to create; if zero, defaults to a value as a function of --staging")
	tags        = flag.String("tags", "", "Comma-separated list of tags. The build key tags should be of the form 'buildkey_linux-arm_HEXHEXHEXHEXHEX'. If empty, it's automatic.")
	staging     = flag.Bool("staging", false, "If true, deploy staging instances (with staging names and tags) instead of prod.")
	listAll     = flag.Bool("list-all", false, "If true, list all (prod, staging, other) current Scaleway servers and stop without making changes.")
	list        = flag.Bool("list", false, "If true, list all prod (or staging, if -staging) servers, including missing ones.")
	fixInterval = flag.Duration("fix-interval", 10*time.Minute, "Interval to wait before running again (only applies to daemon mode)")
	daemonMode  = flag.Bool("daemon", false, "Run in daemon mode in a loop")
)

const (
	// ctype is the Commercial Type of server we use for the builders.
	ctype = "C1"

	scalewayAPIBase = "https://api.scaleway.com"
)

func main() {
	flag.Parse()
	if *tags == "" {
		if *staging {
			*tags = defaultBuilderTags("gobuilder-staging.key")
		} else {<commit_msg>cmd/scaleway: don't populate tags for -list-all mode<commit_after>// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// The scaleway command creates ARM servers on Scaleway.com.
package main

import (
	"bytes"
	"crypto/hmac"
	"crypto/md5"
	"encoding/json"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"os"
	"path/filepath"
	"sort"
	"strings"
	"time"

	"go4.org/types"
	revtype "golang.org/x/build/types"
)

var (
	tokenDir    = flag.String("token-dir", filepath.Join(os.Getenv("HOME"), "keys"), "directory to read gobuilder-staging.key, gobuilder-master.key and go-scaleway.token from.")
	token       = flag.String("token", "", "API token. If empty, the file is read from $(token-dir)/go-scaleway.token. Googlers on the Go team can get the value from http://go/golang-scaleway-token")
	org         = flag.String("org", "1f34701d-668b-441b-bf08-0b13544e99de", "Organization ID (default is <EMAIL>'s account)")
	image       = flag.String("image", "e488d5e3-d278-47a7-8f7d-1154e1f61dc9", "Disk image ID; default is the snapshot we made last")
	num         = flag.Int("n", 0, "Number of servers to create; if zero, defaults to a value as a function of --staging")
	tags        = flag.String("tags", "", "Comma-separated list of tags. The build key tags should be of the form 'buildkey_linux-arm_HEXHEXHEXHEXHEX'. If empty, it's automatic.")
	staging     = flag.Bool("staging", false, "If true, deploy staging instances (with staging names and tags) instead of prod.")
	listAll     = flag.Bool("list-all", false, "If true, list all (prod, staging, other) current Scaleway servers and stop without making changes.")
	list        = flag.Bool("list", false, "If true, list all prod (or staging, if -staging) servers, including missing ones.")
	fixInterval = flag.Duration("fix-interval", 10*time.Minute, "Interval to wait before running again (only applies to daemon mode)")
	daemonMode  = flag.Bool("daemon", false, "Run in daemon mode in a loop")
)

const (
	// ctype is the Commercial Type of server we use for the builders.
	ctype = "C1"

	scalewayAPIBase = "https://api.scaleway.com"
)

func main() {
	flag.Parse()
	if *tags == "" && !*listAll { // Tags aren't needed if -list-all flag is set.
		if *staging {
			*tags = defaultBuilderTags("gobuilder-staging.key")
		} else {
{'fraction_non_alphanumeric': 0.13560411311053985, 'fraction_numerical': 0.022707797772065125, 'mean_word_length': 3.7740286298568506, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '4858241', 'n_tokens_mistral': 1660, 'n_tokens_neox': 1583, 'n_words': 523}