<commit_before>import Mollie
from flask.ext.login import current_user
from flask import abort
from viaduct.models.mollie import Transaction


from viaduct import db, application

MOLLIE = Mollie.API.Client()
MOLLIE_URL = application.config['MOLLIE_URL']
MOLLIE_REDIRECT_URL = application.config['MOLLIE_REDIRECT_URL']
MOLLIE_TEST_MODE = application.config.get('MOLLIE_TEST_MODE', False)
if MOLLIE_TEST_MODE:
    MOLLIE.setApiKey(application.config['MOLLIE_TEST_KEY'])
    print 'USING MOLLIE TEST KEY'
else:
    MOLLIE.setApiKey(application.config['MOLLIE_KEY'])
    print 'USING MOLLIE LIVE KEY'


class MollieAPI:
    @staticmethod
    def create_transaction(amount, description, user=current_user,
                           form_result=None):
        # Only create a new transaction is there is a related form result
        if form_result:
            transaction = Transaction()
            transaction.form_result = form_result
        else:<commit_msg>changes<commit_after>import Mollie
from flask.ext.login import current_user
from flask import abort
from viaduct.models.mollie import Transaction


from viaduct import db, application

MOLLIE = Mollie.API.Client()
MOLLIE_URL = application.config['MOLLIE_URL']
MOLLIE_REDIRECT_URL = application.config['MOLLIE_REDIRECT_URL']
MOLLIE_TEST_MODE = application.config.get('MOLLIE_TEST_MODE', False)
if MOLLIE_TEST_MODE:
    MOLLIE.setApiKey(application.config['MOLLIE_TEST_KEY'])
    print 'USING MOLLIE TEST KEY'
else:
    MOLLIE.setApiKey(application.config['MOLLIE_KEY'])
    print 'USING MOLLIE LIVE KEY'


class MollieAPI:
    @staticmethod
    def create_transaction(amount, description, user=current_user,
                           form_result=None):
        # Only create a new transaction if there is a related form result
        if form_result:
            transaction = Transaction()
            transaction.form_result = form_result
        else:
{'fraction_non_alphanumeric': 0.07628004179728318, 'fraction_numerical': 0.0, 'mean_word_length': 3.89769820971867, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1033815', 'n_tokens_mistral': 621, 'n_tokens_neox': 588, 'n_words': 139}