<commit_before>from flask import render_template, Flask, request, redirect, flash
from app import app
from .forms import RequestForm
import requests
from twilio.rest import TwilioRestClient
import twilio.twiml
import urllib
import math
import sys

'''
@author <NAME>
@author <NAME>
@author <NAME>
@author <NAME>
'''

account_sid = "ACed174aa4db08574d608df749cd16e3fd"
auth_token  = "<PASSWORD>"
client = TwilioRestClient(account_sid, auth_token)
BASE_URL = "https://emergencytexttovoice.herokuapp.com/"

def makeCall(inputText, ip):
	extractedAddress = extractAddress(inputText)
	if extractedAddress != "No address":
	 	location = findClosestPSAP(extractedAddress)
	else:
		location = findClosestPSAP(locationFromIP(ip))
	modifiedText = urllib.quote("P S A P Location is. " + location + "." + "Your Message is. " + inputText)
	urlToMake = BASE_URL + "call/" + modifiedText
	client.calls.create(url = urlToMake , to="+17572823575", from_ = "+12039874014")

def makeCallText(inputText):
	extractedAddress = extractAddress(inputText)
	if extractedAddress != "No address":
	 	location = findClosestPSAP(extractedAddress)
	else:
		location = "No valid address found"
	modifiedText = urllib.quote("P S A P Location is. " + location + "." + "Your Message is. " + inputText)
	urlToMake = BASE_URL + "call/" + modifiedText
	client.calls.create(url = urlToMake , to="+17572823575", from_ = "+12039874014")

@app.route('/sms', methods=['GET', 'POST'])
def default():
	inputText = request.values.get('Body',None)
	makeCallText(inputText)
	return ""

@app.route('/submitted', methods=['GET', 'POST'])
def submitted():
	return render_template('submitted.html')

@app.route('/', methods=['GET', 'POST'])
def form():
	ip = request.remote_addr
	return ip
	form = RequestForm()
	if form.validate_on_submit():
		inputText = form.inputText.data
		makeCall(inputText, ip)<commit_msg>test ip<commit_after>from flask import render_template, Flask, request, redirect, flash
from app import app
from .forms import RequestForm
import requests
from twilio.rest import TwilioRestClient
import twilio.twiml
import urllib
import math
import sys

'''
@author <NAME>
@author <NAME>
@author <NAME>
@author <NAME>
'''

account_sid = "ACed174aa4db08574d608df749cd16e3fd"
auth_token  = "<PASSWORD>"
client = TwilioRestClient(account_sid, auth_token)
BASE_URL = "https://emergencytexttovoice.herokuapp.com/"

def makeCall(inputText, ip):
	extractedAddress = extractAddress(inputText)
	if extractedAddress != "No address":
	 	location = findClosestPSAP(extractedAddress)
	else:
		location = findClosestPSAP(locationFromIP(ip))
	modifiedText = urllib.quote("P S A P Location is. " + location + "." + "Your Message is. " + inputText)
	urlToMake = BASE_URL + "call/" + modifiedText
	client.calls.create(url = urlToMake , to="+17572823575", from_ = "+12039874014")

def makeCallText(inputText):
	extractedAddress = extractAddress(inputText)
	if extractedAddress != "No address":
	 	location = findClosestPSAP(extractedAddress)
	else:
		location = "No valid address found"
	modifiedText = urllib.quote("P S A P Location is. " + location + "." + "Your Message is. " + inputText)
	urlToMake = BASE_URL + "call/" + modifiedText
	client.calls.create(url = urlToMake , to="+17572823575", from_ = "+12039874014")

@app.route('/sms', methods=['GET', 'POST'])
def default():
	inputText = request.values.get('Body',None)
	makeCallText(inputText)
	return ""

@app.route('/submitted', methods=['GET', 'POST'])
def submitted():
	return render_template('submitted.html')

@app.route('/', methods=['GET', 'POST'])
def form():
	ip = request.environ['REMOTE_ADDR']
	return ip
	form = RequestForm()
	if form.validate_on_submit():
		inputText = form.inputText.data
		makeCall(inputText, ip)
{'fraction_non_alphanumeric': 0.13676588897827835, 'fraction_numerical': 0.033252882810404935, 'mean_word_length': 5.757246376811594, 'pattern_counts': {'":': 4, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '1140815', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1253, 'n_words': 304}