<commit_before>from urlparse import parse_qs

from moto.ec2.utils import camelcase_to_underscores, method_namess_from_class

from .amazon_dev_pay import AmazonDevPay
from .amis import AmisResponse
from .availability_zones_and_regions import AvailabilityZonesAndRegions
from .customer_gateways import CustomerGateways
from .dhcp_options import DHCPOptions
from .elastic_block_store import ElasticBlockStore
from .elastic_ip_addresses import ElasticIPAddresses
from .elastic_network_interfaces import ElasticNetworkInterfaces
from .general import General
from .internet_gateways import InternetGateways
from .ip_addresses import IPAddresses
from .key_pairs import KeyPairs
from .monitoring import Monitoring
from .network_acls import NetworkACLs
from .placement_groups import PlacementGroups
from .reserved_instances import ReservedInstances
from .route_tables import RouteTables
from .security_groups import SecurityGroups
from .spot_instances import SpotInstances
from .subnets import Subnets
from .virtual_private_gateways import VirtualPrivateGateways
from .vm_export import VMExport
from .vm_import import VMImport
from .vpcs import VPCs
from .vpn_connections import VPNConnections
from .windows import Windows

from .instances import InstanceResponse
from .tags import TagResponse


class EC2Response(object):

    sub_responses = [InstanceResponse, TagResponse, AmisResponse, AvailabilityZonesAndRegions, SecurityGroups]

    def dispatch(self, uri, body, headers):
        if body:
            querystring = parse_qs(body)
        else:
            querystring = parse_qs(headers)
<commit_msg>clean up ec2 response init<commit_after>from urlparse import parse_qs

from moto.ec2.utils import camelcase_to_underscores, method_namess_from_class

from .amazon_dev_pay import AmazonDevPay
from .amis import AmisResponse
from .availability_zones_and_regions import AvailabilityZonesAndRegions
from .customer_gateways import CustomerGateways
from .dhcp_options import DHCPOptions
from .elastic_block_store import ElasticBlockStore
from .elastic_ip_addresses import ElasticIPAddresses
from .elastic_network_interfaces import ElasticNetworkInterfaces
from .general import General
from .instances import InstanceResponse
from .internet_gateways import InternetGateways
from .ip_addresses import IPAddresses
from .key_pairs import KeyPairs
from .monitoring import Monitoring
from .network_acls import NetworkACLs
from .placement_groups import PlacementGroups
from .reserved_instances import ReservedInstances
from .route_tables import RouteTables
from .security_groups import SecurityGroups
from .spot_instances import SpotInstances
from .subnets import Subnets
from .tags import TagResponse
from .virtual_private_gateways import VirtualPrivateGateways
from .vm_export import VMExport
from .vm_import import VMImport
from .vpcs import VPCs
from .vpn_connections import VPNConnections
from .windows import Windows



class EC2Response(object):

    sub_responses = [
        AmazonDevPay,
        AmisResponse,
        AvailabilityZonesAndRegions,
        CustomerGateways,
        DHCPOptions,
        ElasticBlockStore,
        ElasticIPAddresses,
        ElasticNetworkInterfaces,
        General,
        InstanceResponse,
        InternetGateways,
        IPAddresses,
        KeyPairs,
        Monitoring,
        NetworkACLs,
        PlacementGroups,
        ReservedInstances,
        RouteTables,
        SecurityGroups,
        SpotInstances,
        Subnets,
        TagResponse,
        VirtualPrivateGateways,
        VMExport,
        VMImport,
        VPCs,
        VPNConnections,
        Windows,
    ]

    def dispatch(self, uri, body, headers):
        if body:
            querystring = parse_qs(body)
        else:
            querystring = parse_qs(headers)

{'fraction_non_alphanumeric': 0.03708609271523179, 'fraction_numerical': 0.0013245033112582781, 'mean_word_length': 4.273743016759776, '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': '5977306', 'n_tokens_mistral': 1042, 'n_tokens_neox': 997, 'n_words': 309}