<commit_before>from os import environ
import json
from random import random
import tweepy
import requests
from flask import render_template, redirect, url_for, request, jsonify
from flask.ext.mail import Message
from tweetTrack.app import app, mail
from tweetTrack.app.forms import TwitterForm, ContactForm, APIRequestForm


def get_twitter_api():
    try:
        from tweetTrack.app.config.keys import TwitterKeys
    except ImportError:
        pass
    auth = tweepy.OAuthHandler(
        environ.get('CONSUMER_KEY', TwitterKeys.consumer_key),
        environ.get('CONSUMER_SECRET', TwitterKeys.consumer_secret)
    )
    auth.set_access_token(
        environ.get('ACCESS_KEY', TwitterKeys.access_key),
        environ.get('ACCESS_SECRET', TwitterKeys.access_secret)
    )
    return tweepy.API(auth)


@app.route('/')
@app.route('/index')
def index():
    contact_form = ContactForm()
    twitter_form = TwitterForm()
    api_request_form = APIRequestForm()
    return render_template(
        'index.html',
        contact_form=contact_form,
        twitter_form=twitter_form,
        api_request_form=api_request_form
        )


@app.route('/twitter/<user_name>')
def user_tweets(user_name):
    url = app.config['TRACKING_API_URL']
    data = json.dumps({'screen_name': user_name})
    headers = {
        'Content-Type': 'application/json',
        'Content-Length': len(data)
    }
    response = requests.get(url, data=data, headers=headers)
    response.raise_for_status()
    return jsonify(response=response.json())


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


@app.route('/contact/', methods=['GET', 'POST'])
def contact():
    name = request.args.get('name', 'Name error')
    subject = request.args.get('subject', 'Subject Error')
    email = request.args.get('email', 'Email Error')
    full_subject = '{} - From: {} @ {}'.format(subject, name, email)
    msg = Message(
        full_subject,<commit_msg>Removed about view method that wasn't being used<commit_after>from os import environ
import json
from random import random
import tweepy
import requests
from flask import render_template, redirect, url_for, request, jsonify
from flask.ext.mail import Message
from tweetTrack.app import app, mail
from tweetTrack.app.forms import TwitterForm, ContactForm, APIRequestForm


def get_twitter_api():
    try:
        from tweetTrack.app.config.keys import TwitterKeys
    except ImportError:
        pass
    auth = tweepy.OAuthHandler(
        environ.get('CONSUMER_KEY', TwitterKeys.consumer_key),
        environ.get('CONSUMER_SECRET', TwitterKeys.consumer_secret)
    )
    auth.set_access_token(
        environ.get('ACCESS_KEY', TwitterKeys.access_key),
        environ.get('ACCESS_SECRET', TwitterKeys.access_secret)
    )
    return tweepy.API(auth)


@app.route('/')
@app.route('/index')
def index():
    contact_form = ContactForm()
    twitter_form = TwitterForm()
    api_request_form = APIRequestForm()
    return render_template(
        'index.html',
        contact_form=contact_form,
        twitter_form=twitter_form,
        api_request_form=api_request_form
        )


@app.route('/twitter/<user_name>')
def user_tweets(user_name):
    url = app.config['TRACKING_API_URL']
    data = json.dumps({'screen_name': user_name})
    headers = {
        'Content-Type': 'application/json',
        'Content-Length': len(data)
    }
    response = requests.get(url, data=data, headers=headers)
    response.raise_for_status()
    return jsonify(response=response.json())


@app.route('/contact/', methods=['GET', 'POST'])
def contact():
    name = request.args.get('name', 'Name error')
    subject = request.args.get('subject', 'Subject Error')
    email = request.args.get('email', 'Email Error')
    full_subject = '{} - From: {} @ {}'.format(subject, name, email)
    msg = Message(
        full_subject,
{'fraction_non_alphanumeric': 0.12512846865364852, 'fraction_numerical': 0.0, 'mean_word_length': 3.724514563106796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4298090', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1191, 'n_words': 254}