<commit_before>
"""
    simple test code, only for internal testing

    how to run:
        in miniconda: conda install flask

        $export FLASK_APP=server-debug.py
        $python35 -m flask run

        http://localhost:5000/test
"""

import sys
import socket
from flask import Flask
app = Flask(__name__)


@app.route("/")
def index():
    return socket.gethostname()

"""test service is running"""
@app.route("/test")
def test():
    info={}
    info["python"] = sys.version
    info["runningmode"] = app.debug
    return info["python"] + str(info["runningmode"])


if __name__ == "__main__":

    hostname = socket.gethostname()
    if "MacBook-Air" in hostname:
        app.run(debug=True)
    else:
        app.run(host='0.0.0.0')
<commit_msg>jsonp callback example<commit_after>
"""
    simple test code, only for internal testing

    how to run:
        in miniconda: conda install flask

        $export FLASK_APP=server-debug.py
        $python35 -m flask run

        http://localhost:5000/test
"""

import sys
import socket
from flask import Flask
from flask import request
import json

app = Flask(__name__)


@app.route("/")
def index():
    return socket.gethostname()

"""test service is running"""
@app.route("/test")
def test():
    info={}
    info["python"] = sys.version
    info["runningmode"] = app.debug
    return info["python"] + str(info["runningmode"])

"""insar tool set"""
@app.route("/insar")
def insar():
    info={}
    info['extracminmax'] = extractminmax.__doc__

    return info['extracminmax']

"""extract minmax services"""
@app.route("/insar/extractminmax")
def extractminmax():
    """extract minmax from a image defined by a bbox"""

    if 'extent' in request.args:
        extent = request.args['extent']
    else:
        return "extent is missing"

    if 'image' in request.args:
        image = request.args['image']
    else:
        return "image is missing"

    if 'callback' in request.args:
        callback = request.args['callback']

    return callback + "("+json.dumps(request.args) +")"

if __name__ == "__main__":

    hostname = socket.gethostname()
    if "MacBook-Air" in hostname:
        app.run(debug=True)
    else:
        app.run(host='0.0.0.0')

{'fraction_non_alphanumeric': 0.14272850067537146, 'fraction_numerical': 0.009004952723998198, 'mean_word_length': 3.0036036036036036, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '2982489', 'n_tokens_mistral': 725, 'n_tokens_neox': 704, 'n_words': 195}