e357e1dbcdf36eb12be0bc5043e0a098f94a833a,django/comicsite/templatetags/comic_templatetags.py,comic_URLNode,render,#comic_URLNode#Any#,250

Before Change


        url = super(comic_URLNode, self).render(context)
        url = url.lower()

        if subdomain_is_projectname:
            // Interpret subdomain as a comicsite. What would normally be the
            // path to this comicsite?

            try:
                project = re.findall("^\/site\/([^\/]+)\/.*$", url)[0]

            except IndexError:
                // this url cannot use the domain name shortcut, so it is
                // probably meant as a link the main comicframework site.
                // in that case hardcode the domain to make sure the sub-
                // domain is gone after following this link
                return settings.MAIN_HOST_NAME + url

            url.replace("/site/" + project,"")

        return url


class TagListNode(template.Node):

After Change


            path_to_site = reverse_djangocore("comicsite.views.site", args=[project]).lower()

            if url.startswith(path_to_site):
                return url.replace(path_to_site, "/")

        return url

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: comic/grand-challenge.org
Commit Name: e357e1dbcdf36eb12be0bc5043e0a098f94a833a
Time: 2017-05-09
Author: jamesmeakin@gmail.com
File Name: django/comicsite/templatetags/comic_templatetags.py
Class Name: comic_URLNode
Method Name: render


Project Name: PyThaiNLP/pythainlp
Commit Name: a9ebcc488db9c635c5524de2ba56cee569e91552
Time: 2019-04-17
Author: arthit@gmail.com
File Name: pythainlp/transliterate/royin.py
Class Name:
Method Name: romanize


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 3d95ae5cd11987e4c963baf4da374b1fa139b807
Time: 2016-06-29
Author: carlos.torres@rackspace.com
File Name: perfkitbenchmarker/providers/openstack/os_virtual_machine.py
Class Name: OpenStackVirtualMachine
Method Name: _GetSchedulerHints


Project Name: PyThaiNLP/pythainlp
Commit Name: ebcc42fe046d3126ea1cd0370ca76194d489c8eb
Time: 2019-10-07
Author: arthit@gmail.com
File Name: pythainlp/util/thaiwordcheck.py
Class Name:
Method Name: thaicheck


Project Name: PyThaiNLP/pythainlp
Commit Name: 0c171740243d9fbd3a99dbecbcf5dcc6a1d895f4
Time: 2018-11-11
Author: arthit@gmail.com
File Name: pythainlp/transliterate/royin.py
Class Name:
Method Name: _normalize