48ff898685826a5c37e1914d05ad59408b267528,debug_toolbar/panels/sql/forms.py,SQLSelectForm,make_hash,#SQLSelectForm#,81

Before Change


        items = [data["sql"], data["params"]]
        // Replace lines endings with spaces to preserve the hash value
        // even when the browser normalizes \r\n to \n in inputs.
        items = [" ".join(force_text(item).splitlines()) for item in items]
        return hmac.new(settings.SECRET_KEY.encode("utf-8"),
                        "".join(items).encode("utf-8"), hashlib.sha1).hexdigest()

    @property

After Change


        return reformat_sql(self.cleaned_data["sql"])

    def make_hash(self, data):
        m = hmac.new(key=force_bytes(settings.SECRET_KEY), digestmod=hashlib.sha1)
        for item in [data["sql"], data["params"]]:
            m.update(force_bytes(item))
        return m.hexdigest()

    @property
    def connection(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: jazzband/django-debug-toolbar
Commit Name: 48ff898685826a5c37e1914d05ad59408b267528
Time: 2016-11-07
Author: mejiaa@amazon.com
File Name: debug_toolbar/panels/sql/forms.py
Class Name: SQLSelectForm
Method Name: make_hash


Project Name: masa-su/pixyz
Commit Name: 30028c6256de0cef715095e3994e396025c068d4
Time: 2020-05-04
Author: kaneko@weblab.t.u-tokyo.ac.jp
File Name: pixyz/losses/losses.py
Class Name: Expectation
Method Name: forward


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 8c18cecf15a8935d8bf712edcc91ac05daf2176e
Time: 2020-06-16
Author: tmatsuo@google.com
File Name: appengine/standard/noxfile-template.py
Class Name:
Method Name: