<commit_before>package myaws

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/pkg/errors"
)

type EC2ReservedInstanceOptions struct {
	All       bool
	Quiet     bool
	FilterTag string
	Fields    []string
}

// FindEC2ReservedInstances return an array of reserved instances matching the conditions.
func (client *Client) FindEC2ReservedInstances(all bool) ([]*ec2.ReservedInstances, error) {
	params := &ec2.DescribeReservedInstancesInput{
		Filters: []*ec2.Filter{
			buildEC2RIStateFilter(all),
		},
	}

	response, err := client.EC2.DescribeReservedInstances(params)
	if err != nil {
		return nil, errors.Wrap(err, "DescribeReservedInstances failed")
	}

	var reservedInstances []*ec2.ReservedInstances
	for _, ri := range response.ReservedInstances {
		reservedInstances = append(reservedInstances, ri)
	}

	return reservedInstances, nil
}

func buildEC2RIStateFilter(all bool) *ec2.Filter {
	var stateFilter *ec2.Filter
	if !all {
		stateFilter = &ec2.Filter{
			Name: aws.String("state"),
			Values: []*string{
				aws.String("active"),
			},
		}
	}
	return stateFilter
}
<commit_msg>remove unused type EC2ReservedInstanceOptions<commit_after>package myaws

import (
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/ec2"
	"github.com/pkg/errors"
)

// FindEC2ReservedInstances return an array of reserved instances matching the conditions.
func (client *Client) FindEC2ReservedInstances(all bool) ([]*ec2.ReservedInstances, error) {
	params := &ec2.DescribeReservedInstancesInput{
		Filters: []*ec2.Filter{
			buildEC2RIStateFilter(all),
		},
	}

	response, err := client.EC2.DescribeReservedInstances(params)
	if err != nil {
		return nil, errors.Wrap(err, "DescribeReservedInstances failed")
	}

	var reservedInstances []*ec2.ReservedInstances
	for _, ri := range response.ReservedInstances {
		reservedInstances = append(reservedInstances, ri)
	}

	return reservedInstances, nil
}

func buildEC2RIStateFilter(all bool) *ec2.Filter {
	var stateFilter *ec2.Filter
	if !all {
		stateFilter = &ec2.Filter{
			Name: aws.String("state"),
			Values: []*string{
				aws.String("active"),
			},
		}
	}
	return stateFilter
}

{'fraction_non_alphanumeric': 0.12054794520547946, 'fraction_numerical': 0.012785388127853882, 'mean_word_length': 4.661498708010336, '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': '6149707', 'n_tokens_mistral': 794, 'n_tokens_neox': 757, 'n_words': 154}