def slurp(self):
        self.prep_for_slurp()

        item_list = []
        exception_map = {}
        from security_monkey.common.sts_connect import connect
        for account in self.accounts:
            try:
                ec2 = connect(account, 'ec2')
                regions = ec2.get_all_regions()
            except Exception as e:  # EC2ResponseError
                # Some Accounts don't subscribe to EC2 and will throw an exception here.
                exc = BotoConnectionIssue(str(e), self.index, account, None)
                self.slurp_exception((self.index, account), exc, exception_map)
                continue

            for region in regions:
                app.logger.debug("Checking {}/{}/{}".format(self.index, account, region.name))

                try:
                    rec2 = connect(account, 'ec2', region=region)
                    el_ips = self.wrap_aws_rate_limited_call(
                        rec2.get_all_addresses
                    )
                    # Retrieve account tags to later match assigned EIP to instance
                    tags = self.wrap_aws_rate_limited_call(
                        rec2.get_all_tags
                    )
                except Exception as e:
                    if region.name not in TROUBLE_REGIONS:
                        exc = BotoConnectionIssue(str(e), self.index, account, region.name)
                        self.slurp_exception((self.index, account, region.name), exc, exception_map)
                    continue

                app.logger.debug("Found {} {}".format(len(el_ips), self.i_am_plural))
                for ip in el_ips:

                    if self.check_ignore_list(str(ip.public_ip)):
                        continue

                    instance_name = None
                    instance_tags = [x.value for x in tags if x.name == "Name" and x.res_id == ip.instance_id]
                    if instance_tags:
                        (instance_name,) = instance_tags
                        if self.check_ignore_list(instance_name):
                            continue

                    item_config = {
                        "assigned_to": instance_name,
                        "public_ip": ip.public_ip,
                        "instance_id": ip.instance_id,
                        "domain": ip.domain,
                        "allocation_id": ip.allocation_id,
                        "association_id": ip.association_id,
                        "network_interface_id": ip.network_interface_id,
                        "network_interface_owner_id": ip.network_interface_owner_id,
                        "private_ip_address": ip.private_ip_address
                    }

                    ip_label = "{0}".format(ip.public_ip)

                    item = ElasticIPItem(region=region.name, account=account, name=ip_label, config=item_config)
                    item_list.append(item)

        return item_list, exception_map
Helper function for selecting bad channels.
dataset/ETHPy150Open Netflix/security_monkey/security_monkey/watchers/elastic_ip.py/ElasticIP.slurp--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/viz/epochs.py/_pick_bad_channels