2c909f7d32128c29ff03da7713c3c7edfd91d785,debug_toolbar/panels/sql.py,,reformat_sql,#,127

Before Change



def reformat_sql(sql):
    sql = sql.replace(",", ", ")
    sql = sql.replace("SELECT ", "SELECT\n\t")
    sql = sql.replace(" FROM ", "\nFROM\n\t")
    sql = sql.replace(" WHERE ", "\nWHERE\n\t")
    sql = sql.replace(" INNER JOIN", "\n\tINNER JOIN")
    sql = sql.replace(" LEFT OUTER JOIN" , "\n\tLEFT OUTER JOIN")
    sql = sql.replace(" ORDER BY ", "\nORDER BY\n\t")
    sql = sql.replace(" HAVING ", "\nHAVING\n\t")
    sql = sql.replace(" GROUP BY ", "\nGROUP BY\n\t")
    // Use Pygments to highlight SQL if it"s available

After Change


    return (td.seconds * 1000) + (td.microseconds / 1000.0)

def reformat_sql(sql):
    for kwd in SQL_KEYWORDS:
        sql = sql.replace(kwd, "<strong>%s</strong>" % (kwd,))
    return sql

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: jazzband/django-debug-toolbar
Commit Name: 2c909f7d32128c29ff03da7713c3c7edfd91d785
Time: 2009-08-28
Author: rob@cogit8.org
File Name: debug_toolbar/panels/sql.py
Class Name:
Method Name: reformat_sql


Project Name: graphbrain/graphbrain
Commit Name: 66756de12d3f76d48774434bb210cab39a9590c0
Time: 2020-01-15
Author: telmo@telmomenezes.net
File Name: graphbrain/agents/txt_parser.py
Class Name: TxtParser
Method Name: input_file


Project Name: numenta/NAB
Commit Name: 01014b01722a0b95620c418e9b81582701ce85b0
Time: 2015-09-24
Author: alavin@numenta.com
File Name: tests/integration/corpuslabel_test.py
Class Name: CorpusLabelTest
Method Name: testBucketMerge