<commit_before>import logging
import random
from flask import Flask
from properties import twilio_sid, twilio_auth, receiver_number, twilio_number
from twilio.rest import TwilioRestClient

app = Flask(__name__)

# 4 times a week (on average) if run every minute
MINUTES_IN_WEEK = float(60 * 24 * 7)
TEXTS_PER_WEEK = float(4) / float(60 * 24 * 7)
text_probability = TEXTS_PER_WEEK

messages = [
    "You can do this",
    "Don't rely on your future self, they are unreliable",
    "If you're tempted today. Take a minute and ask why. Is it really *that* good?",
    "Love yourself today",
    "Think about amusement park rides",
    "Think about marrying her",
    "Think about going to the store and everything fitting"
]


@app.route('/text/motivate')
def motivate():
    client = TwilioRestClient(twilio_sid, twilio_auth)
    if random.random() < TEXTS_PER_WEEK:
        logging.info("Sending Text")
        client.messages.create(
            to=receiver_number,
            from_=twilio_number,
            body=random.choice(messages)
        )
    else:
        logging.info("No text this time!")


@app.route('/')
def hello():
    """Return a friendly HTTP greeting."""
    return 'Hello World!'


@app.errorhandler(404)
def page_not_found(e):
    """Return a custom 404 error."""
    return 'Sorry, nothing at this URL.', 404<commit_msg>Make sure a response is returned<commit_after>import logging
import random
from flask import Flask
from properties import twilio_sid, twilio_auth, receiver_number, twilio_number
from twilio.rest import TwilioRestClient

app = Flask(__name__)

# 4 times a week (on average) if run every minute
MINUTES_IN_WEEK = float(60 * 24 * 7)
TEXTS_PER_WEEK = float(4) / float(60 * 24 * 7)
text_probability = TEXTS_PER_WEEK

messages = [
    "You can do this",
    "Don't rely on your future self, they are unreliable",
    "If you're tempted today. Take a minute and ask why. Is it really *that* good?",
    "Love yourself today",
    "Think about amusement park rides",
    "Think about marrying her",
    "Think about going to the store and everything fitting"
]


@app.route('/text/motivate')
def motivate():
    client = TwilioRestClient(twilio_sid, twilio_auth)
    if random.random() < TEXTS_PER_WEEK:
        logging.info("Sending Text")
        client.messages.create(
            to=receiver_number,
            from_=twilio_number,
            body=random.choice(messages)
        )
    else:
        logging.info("No text this time!")
    return 'OK'


@app.route('/')
def hello():
    """Return a friendly HTTP greeting."""
    return 'Hello World!'


@app.errorhandler(404)
def page_not_found(e):
    """Return a custom 404 error."""
    return 'Sorry, nothing at this URL.', 404
{'fraction_non_alphanumeric': 0.10422018348623853, 'fraction_numerical': 0.015412844036697248, 'mean_word_length': 3.382636655948553, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3640934', 'n_tokens_mistral': 906, 'n_tokens_neox': 827, 'n_words': 282}