<commit_before>from flask import Flask
from flask import jsonify
from slack_helper import SlackHelper
import os

app = Flask(__name__)
slack_helper = SlackHelper()

@app.route("/")
def hello():
    return "Bedlam Slack Slash Commands"
    
@app.route("/slash/random-number", methods=['POST'])
def random():
    if not slack_helper.validate_request():
        abort(403)
    
    # chosen by fair dice roll
    # guarenteed to be random
    response = {
        "response_type": "in_channel",
        "text": "Your random number is: 4"
        }
        
    return jsonify(response)

@app.route("/slash/echo", methods=['POST'])
def echo():
    return "hello"

@app.route("/test/env", methods=["GET"])
def test_environment():
    return os.environ["TEST_ENV_VALUE"]
     
if __name__ == "__main__":
    app.run(debug=True)
<commit_msg>added random cat gif endpoint<commit_after>from flask import Flask
from flask import jsonify
from slack_helper import SlackHelper
import os

app = Flask(__name__)
slack_helper = SlackHelper()

@app.route("/")
def hello():
    return "Bedlam Slack Slash Commands"
    
@app.route("/slash/random-number", methods=['POST'])
def random():
    if not slack_helper.validate_request():
        abort(403)
    
    # chosen by fair dice roll
    # guarenteed to be random
    response = {
        "response_type": "in_channel",
        "text": "Your random number is: 4"
        }
        
    return jsonify(response)


@app.route("/slash/cat-gif", methods=['POST'])
def random_cat_gif():
    if not slack_helper.validate_request():
        abort(403)
    
    response = {
        "response_type": "in_channel",
        "text": "Here is your random cat:",
        "attachments" : [
            {
                "image-url" : "http://thecatapi.com/api/images/get?format=src&type=gif"
            }
          ]
        }
        
    return jsonify(response)

@app.route("/slash/echo", methods=['POST'])
def echo():
    return "hello"

@app.route("/test/env", methods=["GET"])
def test_environment():
    return os.environ["TEST_ENV_VALUE"]
     
if __name__ == "__main__":
    app.run(debug=True)

{'fraction_non_alphanumeric': 0.1383529411764706, 'fraction_numerical': 0.0051764705882352945, 'mean_word_length': 2.8937728937728937, 'pattern_counts': {'":': 8, '<': 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': '4051843', 'n_tokens_mistral': 691, 'n_tokens_neox': 674, 'n_words': 166}