<commit_before>from flask import Flask, request
from pbs import mtr

app = Flask(__name__)

@app.route('/')
def displayMTR():
    clientIP = request.environ.get('REMOTE_ADDR')
    reportMTR = mtr("-r","-w",clientIP).stdout
    return "$ mtr -r -w " + clientIP + "\n" + reportMTR

@app.route('/mtrWindowRequest')
def displayMTRBrowser():
    clientIP = request.environ.get('REMOTE_ADDR')
    reportMTR = mtr("-r","-w",clientIP).stdout
    return "<pre>$ mtr -r -w " + clientIP + "\n" + reportMTR + "</pre>"

@app.route('/4/<targetIP4>')
def displayMTRv4(targetIP4):
    reportMTR = mtr("-r","-w","-4",targetIP4).stdout
    return "$ mtr -r -w " + targetIP4 + "\n" + reportMTR

@app.route('/6/<targetIP6>')
def displayMTRv6(targetIP6):
    reportMTR = mtr("-r","-w","-6",targetIP6).stdout
    return "$ mtr -r -w " + targetIP6 + "\n" + reportMTR

@app.route('/ip/<targetIP>')
def displayMTRtarget(targetIP):
    reportMTR = mtr("-r","-w",targetIP).stdout
    return "$ mtr -r -w " + targetIP + "\n" + reportMTR

@app.route('/targetForm')
def targetForm():
    clientIP = request.environ.get('REMOTE_ADDR')
    remoteTarget = request.args.get('remoteTarget', clientIP, type=str)
    reportMTR = mtr("-r","-w",remoteTarget).stdout
    return "<pre>$ mtr -r -w " + remoteTarget + "\n" + reportMTR + "</pre>"

if __name__ == '__main__':
    app.run()<commit_msg>pbs is now sh<commit_after>from flask import Flask, request
from sh import mtr

app = Flask(__name__)

@app.route('/')
def displayMTR():
    clientIP = request.environ.get('REMOTE_ADDR')
    reportMTR = print(mtr("-r","-w",clientIP))
    return "$ mtr -r -w " + clientIP + "\n" + reportMTR

@app.route('/mtrWindowRequest')
def displayMTRBrowser():
    clientIP = request.environ.get('REMOTE_ADDR')
    reportMTR = print(mtr("-r","-w",clientIP))
    return "<pre>$ mtr -r -w " + clientIP + "\n" + reportMTR + "</pre>"

@app.route('/4/<targetIP4>')
def displayMTRv4(targetIP4):
    reportMTR = print(mtr("-r","-w","-4",targetIP4))
    return "$ mtr -r -w " + targetIP4 + "\n" + reportMTR

@app.route('/6/<targetIP6>')
def displayMTRv6(targetIP6):
    reportMTR = print(mtr("-r","-w","-6",targetIP6))
    return "$ mtr -r -w " + targetIP6 + "\n" + reportMTR

@app.route('/ip/<targetIP>')
def displayMTRtarget(targetIP):
    reportMTR = print(mtr("-r","-w",targetIP))
    return "$ mtr -r -w " + targetIP + "\n" + reportMTR

@app.route('/targetForm')
def targetForm():
    clientIP = request.environ.get('REMOTE_ADDR')
    remoteTarget = request.args.get('remoteTarget', clientIP, type=str)
    reportMTR = print(mtr("-r","-w",remoteTarget))
    return "<pre>$ mtr -r -w " + remoteTarget + "\n" + reportMTR + "</pre>"

if __name__ == '__main__':
    app.run()
{'fraction_non_alphanumeric': 0.2065658428624124, 'fraction_numerical': 0.010328292143120619, 'mean_word_length': 3.8256227758007118, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '2069534', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1039, 'n_words': 204}