<commit_before>from flask import render_template
from flask.ext.login import  login_user
from flask_social import login_failed
from flask_social.views import connect_handler
from flask_social.utils import get_connection_values_from_oauth_response
from app.models import security
from app import db, app

import random
import string


@login_failed.connect_via(app)
def on_login_failed(sender, provider, oauth_response):
    print "good"
    connection_values = get_connection_values_from_oauth_response(provider, oauth_response)
    ds = security.datastore
    user = ds.create_user(email='<EMAIL>', password=''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(20)))
    ds.commit()
    connection_values['user_id'] = user.id
    connect_handler(connection_values, provider)
    login_user(user)
    db.session.commit()
    return render_template('main/index.html')<commit_msg>로그인 실패시 생성하는 계정을 랜덤으로<commit_after>from flask import render_template
from flask.ext.login import  login_user
from flask_security.utils import encrypt_password
from flask_social import login_failed
from flask_social.views import connect_handler
from flask_social.utils import get_connection_values_from_oauth_response
from app.models import security
from app import db, app

import random
import string


@login_failed.connect_via(app)
def on_login_failed(sender, provider, oauth_response):
    print "good"
    connection_values = get_connection_values_from_oauth_response(provider, oauth_response)
    ds = security.datastore
    user = ds.create_user(email=''.join(random.choice(string.ascii_uppercase + string.digits)
                                        for _ in range(5))+'<EMAIL>',
                          password=encrypt_password('<PASSWORD>'))
    ds.commit()
    connection_values['user_id'] = user.id
    connect_handler(connection_values, provider)
    login_user(user)
    db.session.commit()
    return render_template('main/index.html')
{'fraction_non_alphanumeric': 0.07967313585291114, 'fraction_numerical': 0.0015321756894790602, 'mean_word_length': 4.900602409638554, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5187273', 'n_tokens_mistral': 591, 'n_tokens_neox': 588, 'n_words': 129}