<commit_before>package awspurge

import (
	awsclient "github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/aws/aws-sdk-go/service/elb"
)

var allRegions = []string{
	"ap-northeast-1",
	"ap-southeast-1",
	"ap-southeast-2",
	"eu-central-1",
	"eu-west-1",
	"sa-east-1",
	"us-east-1",
	"us-west-1",
	"us-west-2",
	// These are problematic for the first time, thus enable later. The user
	// can always define manually and set explicitly if wished.
	// "cn-north-1",
	// "us-gov-west-1",
}

type multiRegion struct {
	ec2 map[string]*ec2.EC2
	elb map[string]*elb.ELB
}

func newMultiRegion(conf *awsclient.Config, regions []string) *multiRegion {
	m := &multiRegion{
		ec2: make(map[string]*ec2.EC2, 0),
		elb: make(map[string]*elb.ELB, 0),
	}

	for _, region := range regions {
		m.ec2[region] = ec2.New(conf.Merge(&awsclient.Config{Region: awsclient.String(region)}))
		m.elb[region] = elb.New(conf.Merge(&awsclient.Config{Region: awsclient.String(region)}))
	}

	return m
}

func filterRegions(regions, excludedRegions []string) []string {<commit_msg>awspurge: sync with new AWS api<commit_after>package awspurge

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/aws/aws-sdk-go/service/elb"
)

var allRegions = []string{
	"ap-northeast-1",
	"ap-southeast-1",
	"ap-southeast-2",
	"eu-central-1",
	"eu-west-1",
	"sa-east-1",
	"us-east-1",
	"us-west-1",
	"us-west-2",
	// These are problematic for the first time, thus enable later. The user
	// can always define manually and set explicitly if wished.
	// "cn-north-1",
	// "us-gov-west-1",
}

type multiRegion struct {
	ec2 map[string]*ec2.EC2
	elb map[string]*elb.ELB
}

func newMultiRegion(conf *aws.Config, regions []string) *multiRegion {
	m := &multiRegion{
		ec2: make(map[string]*ec2.EC2, 0),
		elb: make(map[string]*elb.ELB, 0),
	}

	for _, region := range regions {
		conf.MergeIn(&aws.Config{Region: aws.String(region)})

		m.ec2[region] = ec2.New(session.New(), conf)
		m.elb[region] = elb.New(session.New(), conf)
	}

	return m
}

func filterRegions(regions, excludedRegions []string) []string {
{'fraction_non_alphanumeric': 0.18261269549218032, 'fraction_numerical': 0.020239190432382703, 'mean_word_length': 4.058139534883721, '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': '4901120', 'n_tokens_mistral': 924, 'n_tokens_neox': 895, 'n_words': 167}