65c6e38fa1d0f0d49a3b0dea22047b01bb0d5b13,estnltk/wiki/images.py,,imageParser,#Any#,13

Before Change


    if imageMatches:
        images =  []
        for image in imageMatches:
            imgText = image.group(0).replace("[[", "").replace("]]", "")
            img =  {"text":imgText}


After Change


   ]
    text = ""
    lastEnd = 0
    ends = []
    text = sectionObj["text"]
    imageStarts = [x.start() for x in imageRegEx.finditer(text)]
    if imageStarts:
        images =  []
        for start in imageStarts:

            imgText, end = balancedSlicer(text[start:])
            end = start + end
            ends.append(end)

            //imgText = image.group(0).replace("[[", "").replace("]]", "")
            img =  {"text":imgText}
            imgText = imgText.split("|")

            t= imgText[-1].replace("]]", "")
            url = internalLink.urlBegin + imgText[0].replace(" ", "_").replace("[[", "")
            img["text"] = t
            img["url"] = url

            if ExtLinkBracketedRegex.search(t):
                img = addExternalLinks(img)

            intlinks = [x for x in internalLink.findBalanced(text, openDelim="[[", closeDelim="]]")]

            if intlinks:
                img = internalLink.addIntLinks(img)

            images.append(img)


        sectionObj["images"] = images
        spans = []
        for i, j in zip(imageStarts, ends):
            spans.append((i, j))

        sectionObj["text"] = dropSpans(spans, text)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: estnltk/estnltk
Commit Name: 65c6e38fa1d0f0d49a3b0dea22047b01bb0d5b13
Time: 2015-07-10
Author: amatsin@gmail.com
File Name: estnltk/wiki/images.py
Class Name:
Method Name: imageParser


Project Name: tensorflow/agents
Commit Name: 15355d6b1d45c157badd1c21157b529e817b7c3c
Time: 2019-03-08
Author: sfishman@google.com
File Name: tf_agents/agents/reinforce/reinforce_agent.py
Class Name: ReinforceAgent
Method Name: _train


Project Name: scipy/scipy
Commit Name: fafdd6001a8259f1408bc5f2c2cb91e5eb96c6ca
Time: 2020-08-05
Author: 44255917+swallan@users.noreply.github.com
File Name: benchmarks/benchmarks/stats.py
Class Name: ContinuousFitAnalyticalMLEOverride
Method Name: setup