<commit_before>import os, time, sched, requests, json, HTMLParser
import urlparse, math, collections, re
from flask import *
from flask.ext.sqlalchemy import *
from BeautifulSoup import BeautifulSoup
from adn import *
from flask.ext.wtf.html5 import URLField
from helpers import *



app = Flask(__name__)

app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')

db = SQLAlchemy(app)

app.secret_key = os.environ['APP_SECRET_KEY']

tavorite = Adn(access_token=os.environ['ACCESS_TOKEN'])


@app.route('/')
def home():
    twenty_minutes_ago = datetime.utcnow() - timedelta(seconds=1200)
    links = Post.query.order_by(Post.score_with_time.desc()).filter(~Post.main_url.in_(filter_out_media)).filter(Post.date < twenty_minutes_ago).filter(Post.score >= 2).limit(70).all()
    links = links[0:50]

    if 'access_token' in session:
        username = session['username']
        if not User.query.filter_by(username=username).first():
            user = Adn(access_token=session['access_token']).getSelf()['data']
            add_user_to_db = User(user, access_token=session['access_token'])
            db.session.add(add_user_to_db)
            db.session.commit()
        
        karma_score = User.query.filter_by(username=username).first().karma

        return render_template('show_links.html', age=age, links=links, username=username, voted_for=voted_for, count_comments=count_comments, karma_score=karma_score,newest_class="not-active", vid_class="not-active", sub_class="not-active")
    else:
        return render_template('show_links.html', age=age, links=links, count_comments=count_comments, newest_class="not-active", vid_class="not-active", sub_class="not-active")



@app.route('/videos')
def videos():
    twenty_minutes_ago = datetime.utcnow() - timedelta(seconds=1200)
    media = ['www.youtube.com', 'youtube.com', 'vimeo.com', 'www.vimeo.com']<commit_msg>filtering picture<commit_after>import os, time, sched, requests, json, HTMLParser
import urlparse, math, collections, re
from flask import *
from flask.ext.sqlalchemy import *
from BeautifulSoup import BeautifulSoup
from adn import *
from flask.ext.wtf.html5 import URLField
from helpers import *



app = Flask(__name__)

app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL')

db = SQLAlchemy(app)

app.secret_key = os.environ['APP_SECRET_KEY']

tavorite = Adn(access_token=os.environ['ACCESS_TOKEN'])


@app.route('/')
def home():
    twenty_minutes_ago = datetime.utcnow() - timedelta(seconds=1200)
    links = Post.query.order_by(Post.score_with_time.desc()).filter(~Post.main_url.in_(filter_out_media)).filter(Post.date < twenty_minutes_ago).filter(Post.score >= 2).filter(Post.picture == '').limit(70).all()
    links = links[0:50]

    if 'access_token' in session:
        username = session['username']
        if not User.query.filter_by(username=username).first():
            user = Adn(access_token=session['access_token']).getSelf()['data']
            add_user_to_db = User(user, access_token=session['access_token'])
            db.session.add(add_user_to_db)
            db.session.commit()
        
        karma_score = User.query.filter_by(username=username).first().karma

        return render_template('show_links.html', age=age, links=links, username=username, voted_for=voted_for, count_comments=count_comments, karma_score=karma_score,newest_class="not-active", vid_class="not-active", sub_class="not-active")
    else:
        return render_template('show_links.html', age=age, links=links, count_comments=count_comments, newest_class="not-active", vid_class="not-active", sub_class="not-active")



@app.route('/videos')
def videos():
    twenty_minutes_ago = datetime.utcnow() - timedelta(seconds=1200)
    media = ['www.youtube.com', 'youtube.com', 'vimeo.com', 'www.vimeo.com']
{'fraction_non_alphanumeric': 0.14139827179890024, 'fraction_numerical': 0.007855459544383346, 'mean_word_length': 4.913312693498452, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '592480', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1254, 'n_words': 205}