<commit_before>import redis
import logging
import simplejson as json
import sys
from msgpack import Unpacker
from flask import Flask, request, render_template, redirect
from daemon import runner
from os.path import dirname, abspath
from os import path
import msgpack

import csv


# add the shared settings file to namespace
sys.path.insert(0, dirname(dirname(abspath(__file__))))
import settings

REDIS_CONN = redis.StrictRedis(unix_socket_path=settings.REDIS_SOCKET_PATH)

app = Flask(__name__)
app.config['PROPAGATE_EXCEPTIONS'] = True

@app.route("/")
def index():
    return render_template('index.html'), 200

@app.route("/load_mock_data")
def load_mock_data():
    try:

        FULL_NAMESPACE = settings.FULL_NAMESPACE
        full_uniques = FULL_NAMESPACE + 'unique_metrics'
        r = redis.StrictRedis(unix_socket_path=settings.REDIS_SOCKET_PATH)
        pipe = r.pipeline()

        with open('/home/ubuntu/cloudbrain/src/webapp/static/data/data.json', 'rb') as jsonfile:
            data = json.load(jsonfile)
            for channel_data in data:
                values = channel_data['values']<commit_msg>demo endpoint<commit_after>import redis
import logging
import simplejson as json
import sys
from msgpack import Unpacker
from flask import Flask, request, render_template, redirect
from daemon import runner
from os.path import dirname, abspath
from os import path
import msgpack

import csv


# add the shared settings file to namespace
sys.path.insert(0, dirname(dirname(abspath(__file__))))
import settings

REDIS_CONN = redis.StrictRedis(unix_socket_path=settings.REDIS_SOCKET_PATH)

app = Flask(__name__)
app.config['PROPAGATE_EXCEPTIONS'] = True

@app.route("/")
def index():
    return render_template('index.html'), 200

@app.route("/demo")
def demo():
    return render_template('static/demo/build/index.html'), 200


@app.route("/load_mock_data")
def load_mock_data():
    try:

        FULL_NAMESPACE = settings.FULL_NAMESPACE
        full_uniques = FULL_NAMESPACE + 'unique_metrics'
        r = redis.StrictRedis(unix_socket_path=settings.REDIS_SOCKET_PATH)
        pipe = r.pipeline()

        with open('/home/ubuntu/cloudbrain/src/webapp/static/data/data.json', 'rb') as jsonfile:
            data = json.load(jsonfile)
            for channel_data in data:
                values = channel_data['values']
{'fraction_non_alphanumeric': 0.09786324786324786, 'fraction_numerical': 0.004700854700854701, 'mean_word_length': 4.111353711790393, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '3669737', 'n_tokens_mistral': 757, 'n_tokens_neox': 730, 'n_words': 180}