<commit_before>from connections import connector
import config
import generic
from django.shortcuts import render
from django.contrib.auth.decorators import login_required

@login_required
def index(request):
    '''
    Handler for the dashboard main page
    '''
    currect_section = 'dashboard'
    
    balances = connector.getbalance()
    transactions_by_currency = connector.listtransactions(limit=40, start=0)
    transactions = []
    for currency in transactions_by_currency:
        for transaction in transactions_by_currency[currency]:
            transaction['currency'] = currency
            transactions.append(transaction)
    
    # sort result
    transactions = sorted(transactions, key=lambda k: k.get('time',0), reverse=True)
    
    # get only 10 transactions
    transactions = transactions[:10]
    
    for transaction in transactions:
        transaction['currency_symbol'] = generic.getCurrencySymbol(transaction['currency'].lower())
        if transaction['category'] == 'receive':
            transaction['source_address'] = transaction.get('details', {}).get('sender_address', '(no sender address)')
            transaction['destination_address'] = transaction['address']
            transaction['icon'] = 'glyphicon-circle-arrow-down'
        elif transaction['category'] == 'send':
            transaction['source_address'] = connector.getaddressesbyaccount(transaction['account'], transaction['currency'])<commit_msg>debug mode<commit_after>from connections import connector
import config
import generic
from django.shortcuts import render
from django.contrib.auth.decorators import login_required

@login_required
def index(request):
    '''
    Handler for the dashboard main page
    '''
    currect_section = 'dashboard'
    
    balances = connector.getbalance()
    transactions_by_currency = connector.listtransactions(limit=20, start=0)
    transactions = []
    for currency in transactions_by_currency:
        for transaction in transactions_by_currency[currency]:
            transaction['currency'] = currency
            transactions.append(transaction)
    
    # sort result
    transactions = sorted(transactions, key=lambda k: k.get('time',0), reverse=True)
    
    # get only 10 transactions
    #transactions = transactions[:10]
    
    for transaction in transactions:
        transaction['currency_symbol'] = generic.getCurrencySymbol(transaction['currency'].lower())
        if transaction['category'] == 'receive':
            transaction['source_address'] = transaction.get('details', {}).get('sender_address', '(no sender address)')
            transaction['destination_address'] = transaction['address']
            transaction['icon'] = 'glyphicon-circle-arrow-down'
        elif transaction['category'] == 'send':
            transaction['source_address'] = connector.getaddressesbyaccount(transaction['account'], transaction['currency'])
{'fraction_non_alphanumeric': 0.10977288368891948, 'fraction_numerical': 0.0055058499655884375, 'mean_word_length': 3.9271186440677965, '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': '4508801', 'n_tokens_mistral': 714, 'n_tokens_neox': 700, 'n_words': 166}