793fcb88effdfee8121f2000e3d9a04d3ddc51ae,debug_toolbar/panels/sql/panel.py,SQLPanel,generate_stats,#SQLPanel#Any#Any#,141
Before Change
// Queries are duplicates only if there"s as least 2 of them.
// Also, to hide queries, we need to give all the duplicate groups an id
query_colors = contrasting_color_generator()
query_duplicates = dict(
(alias, dict(
(query, (duplicate_count, next(query_colors)))
for query, duplicate_count in queries.items()
if duplicate_count >= 2
))
for alias, queries in query_duplicates.items()
)
for alias, query in self._queries:
try:
duplicates_count, color = query_duplicates[alias][query["raw_sql"]]
query["duplicate_count"] = duplicates_count
query["duplicate_color"] = color
except KeyError:
pass
for alias, alias_info in self._databases.items():
try:
alias_info["duplicate_count"] = sum(e[0] for e in query_duplicates[alias].values())
except KeyError:
pass
After Change
// Queries are duplicates only if there"s as least 2 of them.
// Also, to hide queries, we need to give all the duplicate groups an id
query_colors = contrasting_color_generator()
query_duplicates = {
alias: {
query: (duplicate_count, next(query_colors))
for query, duplicate_count in queries.items()
if duplicate_count >= 2
}
for alias, queries in query_duplicates.items()
}
for alias, query in self._queries:
try:
duplicates_count, color = query_duplicates[alias][query["raw_sql"]]
query["duplicate_count"] = duplicates_count
query["duplicate_color"] = color
except KeyError:
pass
for alias, alias_info in self._databases.items():
try:
alias_info["duplicate_count"] = sum(e[0] for e in query_duplicates[alias].values())
except KeyError:
pass
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: jazzband/django-debug-toolbar
Commit Name: 793fcb88effdfee8121f2000e3d9a04d3ddc51ae
Time: 2017-04-29
Author: jon.dufresne@gmail.com
File Name: debug_toolbar/panels/sql/panel.py
Class Name: SQLPanel
Method Name: generate_stats
Project Name: Microsoft/nni
Commit Name: 7c4b8c0d3d7d14c362892e44a1d256732d13a258
Time: 2019-10-29
Author: 40699903+liuzhe-lz@users.noreply.github.com
File Name: src/sdk/pynni/nni/hyperopt_tuner/hyperopt_tuner.py
Class Name: HyperoptTuner
Method Name: miscs_update_idxs_vals
Project Name: sahana/eden
Commit Name: cd9f908d3b150dacd81b08212364a72d6664dcc8
Time: 2019-07-09
Author: dominic@nursix.org
File Name: modules/s3/s3grouped.py
Class Name: S3GroupedItems
Method Name: json