def genXML(self):
        """
            Return XML root
        """
        # Check conditions
        if self.filename is None or \
                self.foldername is None or \
                self.imgSize is None or \
                0 <= len(self.boxlist):
                    return None

        top = Element('annotation')
        folder = SubElement(top,'folder')
        folder.text = self.foldername

        filename = SubElement(top,'filename')
        filename.text = self.filename

        localImgPath = SubElement(top,'path')
        localImgPath.text = self.localImgPath

        source = SubElement(top,'source')
        database = SubElement(source,'database')
        database.text = self.databaseSrc

        size_part = SubElement(top,'size')
        width = SubElement(size_part,'width')
        height = SubElement(size_part,'height')
        depth = SubElement(size_part,'depth')
        width.text = str(self.imgSize[1])
        height.text = str(self.imgSize[0])
        if len(self.imgSize)==3:
            depth.text = str(self.imgSize[2])
        else:
            depth.text = '1'

        segmented = SubElement(top,'segmented')
        segmented.text ='0'

        return top
dataset/ETHPy150Open tzutalin/labelImg/libs/pascal_voc_io.py/PascalVocWriter.genXML/swapped operands of `<=`