def _examine_content(self, content):
        """Modify template content to handle plural data in target language"""
        if isinstance(content, unicode):
            content = content.encode('utf-8')
        doc = xml.dom.minidom.parseString(content)
        root = doc.documentElement
        rules = self.language.get_pluralrules_numbers()
        plurals = SourceEntity.objects.filter(resource = self.resource, pluralized=True)
        if self.language != self.resource.source_language and plurals:
            for entity in plurals:
                match = False
                for group_node in root.getElementsByTagName("group"):
                    if group_node.attributes['restype'].value == "x-gettext-plurals":
                        trans_unit_nodes = group_node.getElementsByTagName("trans-unit")
                        if self.getElementByTagName(trans_unit_nodes[0], "source").firstChild.data == entity.string_hash:
                            match = True
                            break
                if not match:
                    continue
            for count,rule in enumerate(rules):
                if rule == 0:
                    clone = trans_unit_nodes[1].cloneNode(deep=True)
                    target = self.getElementByTagName(clone, "target")
                    target.firstChild.data = target.firstChild.data[:-1] + '0'
                    clone.setAttribute("id", group_node.attributes["id"].value+'[%d]'%count)
                    indent_node = trans_unit_nodes[0].previousSibling.cloneNode(deep=True)
                    group_node.insertBefore(indent_node, trans_unit_nodes[0].previousSibling)
                    group_node.insertBefore(clone, trans_unit_nodes[0].previousSibling)
                if rule == 1:
                    trans_unit_nodes[0].setAttribute("id", group_node.attributes["id"].value+'[%d]'%count)
                if rule in range(2, 5):
                    clone = trans_unit_nodes[1].cloneNode(deep=True)
                    target = self.getElementByTagName(clone, "target")
                    target.firstChild.data = target.firstChild.data[:-1] + rule%'%d'
                    clone.setAttribute("id", group_node.attributes["id"].value+'[%d]'%count)
                    indent_node = trans_unit_nodes[1].previousSibling.cloneNode(deep=True)
                    group_node.insertBefore(indent_node, trans_unit_nodes[1].previousSibling)
                    group_node.insertBefore(clone, trans_unit_nodes[1].previousSibling)
                if rule == 5:
                    trans_unit_nodes[1].setAttribute("id", group_node.attributes["id"].value+'[%d]'%count)
        content = doc.toxml()
        return content
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/resources/formats/xliff.py/XliffHandler._examine_content/swapped operands of `%`