def _copyDomainCallback3(self, data, source_domain, destination_domain,
        total_box_usage=0):
        xml = ET.fromstring(data["response"])
        box_usage = float(xml.find(".//%sBoxUsage" % SDB_NAMESPACE).text)
        self.box_usage += box_usage
        total_box_usage += box_usage
        next_token_element = xml.find(".//%sNextToken" % SDB_NAMESPACE)
        if next_token_element is not None:
            next_token = next_token_element.text
        else:
            next_token = None
        items = xml.findall(".//%sItem" % SDB_NAMESPACE)
        results = {}
        for item in items:
            key = item.find("./%sName" % SDB_NAMESPACE).text
            attributes = item.findall("%sAttribute" % SDB_NAMESPACE)
            attribute_dict = {}
            for attribute in attributes:
                attr_name = attribute.find("./%sName" % SDB_NAMESPACE).text
                attr_value = attribute.find("./%sValue" % SDB_NAMESPACE).text
                if attr_name in attribute_dict:  
                    attribute_dict[attr_name].append(attr_value)
                else:
                    attribute_dict[attr_name] = [attr_value]
            results[key] = attribute_dict
        deferreds = []
        for key in results:
            d = self.putAttributes(destination_domain, key, results[key])
            d.addErrback(self._copyPutAttributesErrback, destination_domain, key, results[key])
            deferreds.append(d)
        d = DeferredList(deferreds, consumeErrors=True)
        d.addCallback(self._copyDomainCallback4, source_domain,
            destination_domain, next_token=next_token, total_box_usage=total_box_usage)
        return d
dataset/ETHPy150Open wehriam/awspider/awspider/aws/sdb.py/AmazonSDB._copyDomainCallback3/original