<commit_before># -*- coding: utf-8 -*
"""
    Getting currency exchange rates for today and yesterday. The source is an XML file
    Source of data is http://www.ecb.int/stats/eurofxref/eurofxref-hist-90d.xml

    (c) NTB 2007-: <NAME> (510 / <EMAIL>)
    This solution gets data form http://www.dnbnor.no until the bank of norway sets up an xml-feed.
    Version 0.9
    Corrected fetching data from ebc and corrected decimals
"""

import xml.etree.cElementTree as ElementTree
import urllib3
import datetime

currencies = [
    {'currency': 'USD', 'name': 'US dollar', 'multiplication': 1},
    {'currency': 'NOK', 'name': 'EURO', 'multiplication': 0},
    {'currency': 'CHF', 'name': 'Sveitiske franc', 'multiplication': 100},
    {'currency': 'DKK', 'name': 'Danske kroner', 'multiplication': 100},
    {'currency': 'GBP', 'name': 'Britiske pund ', 'multiplication': 1},
    {'currency': 'SEK', 'name': 'Svenske kroner', 'multiplication': 100},
    {'currency': 'CAD', 'name': 'Canadiske dollar', 'multiplication': 1},
    {'currency': 'JPY', 'name': 'Japanske yen', 'multiplication': 100}
]

template = '<tr><td>{name}&nbsp;({currency})</td><td>{today}</td><td>({yesterday})</td></tr>'


def generate_row(currency, currency_name, multiplication, euro_currency, today_currency, yesterday_currency):
    today_rate = today_currency if multiplication == 0 else ''
    yesterday_rate = yesterday_currency if multiplication == 0 else ''

    if today_currency and multiplication:
        today_rate = "{0:.4f}".format(float(euro_currency) * multiplication / float(today_currency))
<commit_msg>Corrected typo on swiss franc<commit_after># -*- coding: utf-8 -*
"""
    Getting currency exchange rates for today and yesterday. The source is an XML file
    Source of data is http://www.ecb.int/stats/eurofxref/eurofxref-hist-90d.xml

    (c) NTB 2007-: <NAME> (510 / <EMAIL>)
    This solution gets data form http://www.dnbnor.no until the bank of norway sets up an xml-feed.
    Version 0.9
    Corrected fetching data from ebc and corrected decimals
"""

import xml.etree.cElementTree as ElementTree
import urllib3
import datetime

currencies = [
    {'currency': 'USD', 'name': 'US dollar', 'multiplication': 1},
    {'currency': 'NOK', 'name': 'EURO', 'multiplication': 0},
    {'currency': 'CHF', 'name': 'Sveitsiske franc', 'multiplication': 100},
    {'currency': 'DKK', 'name': 'Danske kroner', 'multiplication': 100},
    {'currency': 'GBP', 'name': 'Britiske pund ', 'multiplication': 1},
    {'currency': 'SEK', 'name': 'Svenske kroner', 'multiplication': 100},
    {'currency': 'CAD', 'name': 'Canadiske dollar', 'multiplication': 1},
    {'currency': 'JPY', 'name': 'Japanske yen', 'multiplication': 100}
]

template = '<tr><td>{name}&nbsp;({currency})</td><td>{today}</td><td>({yesterday})</td></tr>'


def generate_row(currency, currency_name, multiplication, euro_currency, today_currency, yesterday_currency):
    today_rate = today_currency if multiplication == 0 else ''
    yesterday_rate = yesterday_currency if multiplication == 0 else ''

    if today_currency and multiplication:
        today_rate = "{0:.4f}".format(float(euro_currency) * multiplication / float(today_currency))

{'fraction_non_alphanumeric': 0.16744767260231178, 'fraction_numerical': 0.020618556701030927, 'mean_word_length': 4.64726631393298, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 6}, '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': '5366877', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1013, 'n_words': 296}