90bbf47abab22b01d073f6565f57097cd6c16a66,nala/bootstrapping/utils.py,DownloadArticle,download,#DownloadArticle#Any#,81

Before Change


            counter = 0

            // for now only include title and abstract
            for elem in xml.findall(".//ArticleTitle"):
                doc.parts["part_{}".format(counter)] = Part(elem.text)
                counter += 1
            for elem in xml.findall(".//AbstractText"):
                doc.parts["part_{}".format(counter)] = Part(elem.text)
                counter += 1

After Change



            doc = Document()

            if self.one_part:
                joined_text = "\n".join(element.text for element in
                                        chain(xml.findall(".//ArticleTitle"), xml.findall(".//AbstractText")))
                doc.parts["title_and_abstract"] = Part(joined_text)
            else:
                counter = 0
                // for now only include title and abstract
                for elem in xml.findall(".//ArticleTitle"):
                    doc.parts["part_{}".format(counter)] = Part(elem.text)
                    counter += 1
                for elem in xml.findall(".//AbstractText"):
                    doc.parts["part_{}".format(counter)] = Part(elem.text)
                    counter += 1

            // yield the document but only if you found anything
            if len(doc.parts) > 0:
                yield pmid, doc

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: Rostlab/nalaf
Commit Name: 90bbf47abab22b01d073f6565f57097cd6c16a66
Time: 2015-10-14
Author: aleksandar.bojchevski@gmail.com
File Name: nala/bootstrapping/utils.py
Class Name: DownloadArticle
Method Name: download


Project Name: gyoisamurai/GyoiThon
Commit Name: b337f47935c2cb4cb42085f390a0dbeebdd95b47
Time: 2021-02-19
Author: null
File Name: modules/Gyoi_Inventory.py
Class Name: Inventory
Method Name: dns_explore


Project Name: deepfakes/faceswap
Commit Name: 0f8d9db826d7588f9feb151ab234f2aaf0d8ecf2
Time: 2018-02-01
Author: gdunstone@users.noreply.github.com
File Name: scripts/convert.py
Class Name: ConvertImage
Method Name: convert