<commit_before>from flask import Flask, request, session, g, redirect, url_for, \
     abort, render_template, flash
import psycopg2, psycopg2.extras

app = Flask(__name__)
app.config.from_object(__name__)
app.config.from_envvar('FLASKR_SETTINGS', silent=True)


@app.route('/')
def status():
    try:
        conn = psycopg2.connect("dbname='myops2' user='myops2' host='localhost' password='<PASSWORD>'")
        cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
    except:
            raise Exception("Unable to connect to the database")
    
    try:
        cursor.execute("select * from status;")
        resources = cursor.fetchall()
    except Exception as e:
        raise Exception("Unable to retrieve data from database: %s" % e)
    
    return render_template('status.html', resources=resources)


if __name__ == '__main__':
    app.run()<commit_msg>listen on pub interface<commit_after>from flask import Flask, request, session, g, redirect, url_for, \
     abort, render_template, flash
import psycopg2, psycopg2.extras

app = Flask(__name__)
app.config.from_object(__name__)
app.config.from_envvar('FLASKR_SETTINGS', silent=True)


@app.route('/')
def status():
    try:
        conn = psycopg2.connect("dbname='myops2' user='myops2' host='localhost' password='<PASSWORD>'")
        cursor = conn.cursor(cursor_factory=psycopg2.extras.DictCursor)
    except:
            raise Exception("Unable to connect to the database")
    
    try:
        cursor.execute("select * from status;")
        resources = cursor.fetchall()
    except Exception as e:
        raise Exception("Unable to retrieve data from database: %s" % e)
    
    return render_template('status.html', resources=resources)


if __name__ == '__main__':
    app.run(host='0.0.0.0')
{'fraction_non_alphanumeric': 0.12373453318335208, 'fraction_numerical': 0.008998875140607425, 'mean_word_length': 3.744, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '470852', 'n_tokens_mistral': 556, 'n_tokens_neox': 553, 'n_words': 132}