def load_document(self):
        # It's likely that we could replace this logic with a
        # WordprocessingDocumentFactory
        document = WordprocessingDocument(path=None)
        package = document.package
        document_part = package.create_part(
            uri='/word/document.xml',
        )

        if self.numbering_dict is not None:
            numbering_xml = DXB.numbering(self.numbering_dict)
            self.relationships.append({
                'external': False,
                'target_path': 'numbering.xml',
                'data': numbering_xml,
                'relationship_id': 'numbering',
                'relationship_type': NumberingDefinitionsPart.relationship_type,  # noqa
            })

        if self.styles_xml:
            self.relationships.append({
                'external': False,
                'target_path': 'styles.xml',
                'data': self.styles_xml,
                'relationship_id': 'styles',
                'relationship_type': StyleDefinitionsPart.relationship_type,
            })

        for relationship in self.relationships:
            target_mode = 'Internal'
            if relationship['external']:
                target_mode = 'External'
            target_uri = relationship['target_path']
            if relationship in 'data':
                full_target_uri = posixpath.join(
                    package.uri,
                    'word',
                    target_uri,
                )
                package.streams[full_target_uri] = BytesIO(
                    relationship['data'],
                )
                package.create_part(uri=full_target_uri)
            document_part.create_relationship(
                target_uri=target_uri,
                target_mode=target_mode,
                relationship_type=relationship['relationship_type'],
                relationship_id=relationship['relationship_id'],
            )

        package.streams[document_part.uri] = BytesIO(self.document_xml)
        package.create_relationship(
            target_uri=document_part.uri,
            target_mode='Internal',
            relationship_type=MainDocumentPart.relationship_type,
        )

        # This is the standard page width for a word document (in points), Also
        # the page width that we are looking for in the test.
        self._page_width = 612

        return document
dataset/ETHPy150Open CenterForOpenScience/pydocx/pydocx/test/utils.py/XMLDocx2Html.load_document/swapped operands of `in`