<commit_before>from flask import Flask, url_for, request,Response, send_file, redirect
import ipsum.generator as ipsum_generator
import placeholder_graphic.generator as image_generator
import json
import os

app = Flask(__name__,static_url_path='/static')

@app.route('/')
def default():
    return redirect(url_for('ipsum'))
    
@app.route('/about')
def about():
    return app.send_static_file('about.html')

@app.route('/image')
def images():
    return app.send_static_file('images.html')
    
@app.route('/<path:static_type>/<path:path>')
def serve_js(static_type,path):
    return app.send_static_file(os.path.join(static_type, path))

@app.route('/ipsum')
def ipsum():
    return app.send_static_file('generate.html')

@app.route('/ipsum/generate', methods=['GET'])
def generate_ipsum():
    # defaults
    p=4
    s_variance=0
    include_enochian=False
    enochian_weight=1
    return_data = { 'text': '', 'success': 'false', 'status':500 }

    if 'p' in request.args:
        p=int(request.args['p'])
    if 'sentence_variance' in request.args:
        s_variance = int(request.args['sentence_variance'])
    if 'include_enochian' in request.args:
        if request.args['include_enochian'] in ['true','True']:
            include_enochian = True
    if 'enochian_weight' in request.args:
        enochian_weight = int(request.args['enochian_weight'])<commit_msg>added cros-domain decorator to ipsum/generate<commit_after>from flask import Flask, url_for, request,Response, send_file, redirect
import ipsum.generator as ipsum_generator
import placeholder_graphic.generator as image_generator
import json
import os

app = Flask(__name__,static_url_path='/static')

@app.route('/')
def default():
    return redirect(url_for('ipsum'))
    
@app.route('/about')
def about():
    return app.send_static_file('about.html')

@app.route('/image')
def images():
    return app.send_static_file('images.html')
    
@app.route('/<path:static_type>/<path:path>')
def serve_js(static_type,path):
    return app.send_static_file(os.path.join(static_type, path))

@app.route('/ipsum')
def ipsum():
    return app.send_static_file('generate.html')

@app.route('/ipsum/generate', methods=['GET'])
@crossdomain(origin='*')
def generate_ipsum():
    # defaults
    p=4
    s_variance=0
    include_enochian=False
    enochian_weight=1
    return_data = { 'text': '', 'success': 'false', 'status':500 }

    if 'p' in request.args:
        p=int(request.args['p'])
    if 'sentence_variance' in request.args:
        s_variance = int(request.args['sentence_variance'])
    if 'include_enochian' in request.args:
        if request.args['include_enochian'] in ['true','True']:
            include_enochian = True
    if 'enochian_weight' in request.args:
        enochian_weight = int(request.args['enochian_weight'])
{'fraction_non_alphanumeric': 0.14692280327285664, 'fraction_numerical': 0.004268943436499467, 'mean_word_length': 4.513725490196078, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6832645', 'n_tokens_mistral': 945, 'n_tokens_neox': 931, 'n_words': 182}