a method to discover the list of subnets on AWS EC2

        :param tag_values: [optional] list of tag values
        :return: list of strings with subnet ids

def list_subnets(self, tag_values=None):

        '''
            a method to discover the list of subnets on AWS EC2

        :param tag_values: [optional] list of tag values
        :return: list of strings with subnet ids
        '''

        title = '%s.list_subnets' % self.__class__.__name__

    # validate inputs
        input_fields = {
            'tag_values': tag_values
        }
        for key, value in input_fields.items():
            if value:
                object_title = '%s(%s=%s)' % (title, key, str(value))
                self.fields.validate(value, '.%s' % key, object_title)
            
    # add tags to method arguments
        kw_args = {}
        tag_text = ''
        if tag_values:
            kw_args = {
                'Filters': [ { 'Name': 'tag-value', 'Values': tag_values } ]
            }
            from labpack.parsing.grammar import join_words
            plural_value = ''
            if len(tag_values) > 1:
                plural_value = 's'
            tag_text = ' with tag value%s %s' % (plural_value, join_words(tag_values))
            
    # request instance details from AWS
        self.iam.printer('Querying AWS region %s for subnets%s.' % (self.iam.region_name, tag_text))
        subnet_list = []
        try:
            if kw_args:
                response = self.connection.describe_subnets(**kw_args)
            else:
                response = self.connection.describe_subnets()
        except:
            raise AWSConnectionError(title)
        response_list = []
        if 'Subnets' in response:
            response_list = response['Subnets']

    # construct list of subnets from response
        for sub_dict in response_list:
            subnet_list.append(sub_dict['SubnetId'])

    # report results and return list
        if subnet_list:
            print_out = 'Found subnet'
            if len(subnet_list) > 1:
                print_out += 's'
            from labpack.parsing.grammar import join_words
            print_out += ' %s.' % join_words(subnet_list)
            self.iam.printer(print_out)
        else:
            self.iam.printer('No subnets found.')

        return subnet_list