<commit_before># coding: utf-8
"""
PAP XML and remote API URLs
"""
from collections import (
    namedtuple,
    OrderedDict
)
import requests
from lxml import etree

PAP_BASE_URL = 'https://www.bmf-steuerrechner.de'

PapResource = namedtuple('PapResource', ('remote_service_path', 'pap_xml_path'))

PAP_RESOURCES = OrderedDict((
    ('2006', PapResource(
        '/interface/2006Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2006Big.xml.xhtml'
    )),
    ('2007', PapResource(
        '/interface/2007Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2007Big.xml.xhtml'
    )),
    ('2008', PapResource(
        '/interface/2008Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2008Big.xml.xhtml'
    )),
    ('2009', PapResource(
        '/interface/2009Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2009Big.xml.xhtml'
    )),
    ('2010', PapResource(
        '/interface/2010Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2010Big.xml.xhtml'
    )),
    ('2011bisNov', PapResource(
        '/interface/2011bisNovVersion1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2011BisNovember.xml.xhtml'
    )),
    ('2011Dez', PapResource(
        '/interface/2011DezVersion1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2011Dezember.xml.xhtml'
    )),
    ('2012', PapResource(
        '/interface/2012Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2012.xml.xhtml'
    )),
    ('2013', PapResource(
        '/interface/2013Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2013.xml.xhtml'
    )),
    ('2014', PapResource(
        '/interface/2014Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2014.xml.xhtml'
    )),
    ('2015bisNov', PapResource(
        '/interface/2015bisNovVersion1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2015BisNovember.xml.xhtml'
    )),
    ('2015Dez', PapResource(
        '/interface/2015DezVersion1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2015Dezember.xml.xhtml'
    )),
    ('2016', PapResource(
        '/interface/2016Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2016.xml.xhtml'
    )),
    ('2017', PapResource(
        '/interface/2017Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2017.xml.xhtml'
    )),
    ('2018', PapResource(
        '/interface/2018Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2018.xml.xhtml'
    )),
    ('2019', PapResource(
        '/interface/2019Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2019.xml.xhtml'
    )),
    ('2020', PapResource(
        '/interface/2020Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2020.xml.xhtml'
    )),
))


def get_pap_xml(pap_resource_name):
    """ Fetch PAP XML from bmf-steuerrechner.de and return
        it as a string.
    """
    resource = PAP_RESOURCES.get(pap_resource_name)<commit_msg>better naming convention for PAP files<commit_after># coding: utf-8
"""
PAP XML and remote API URLs
"""
from collections import (
    namedtuple,
    OrderedDict
)
import requests
from lxml import etree

PAP_BASE_URL = 'https://www.bmf-steuerrechner.de'

PapResource = namedtuple('PapResource', ('remote_service_path', 'pap_xml_path'))

PAP_RESOURCES = OrderedDict((
    ('2006_1', PapResource(
        '/interface/2006Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2006Big.xml.xhtml'
    )),
    ('2007_1', PapResource(
        '/interface/2007Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2007Big.xml.xhtml'
    )),
    ('2008_1', PapResource(
        '/interface/2008Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2008Big.xml.xhtml'
    )),
    ('2009_1', PapResource(
        '/interface/2009Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2009Big.xml.xhtml'
    )),
    ('2010_1', PapResource(
        '/interface/2010Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2010Big.xml.xhtml'
    )),
    ('2011_1', PapResource(
        '/interface/2011bisNovVersion1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2011BisNovember.xml.xhtml'
    )),
    ('2011_12', PapResource(
        '/interface/2011DezVersion1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2011Dezember.xml.xhtml'
    )),
    ('2012_1', PapResource(
        '/interface/2012Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2012.xml.xhtml'
    )),
    ('2013_1', PapResource(
        '/interface/2013Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2013.xml.xhtml'
    )),
    ('2014_1', PapResource(
        '/interface/2014Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2014.xml.xhtml'
    )),
    ('2015_1', PapResource(
        '/interface/2015bisNovVersion1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2015BisNovember.xml.xhtml'
    )),
    ('2015_12', PapResource(
        '/interface/2015DezVersion1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2015Dezember.xml.xhtml'
    )),
    ('2016_1', PapResource(
        '/interface/2016Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2016.xml.xhtml'
    )),
    ('2017_1', PapResource(
        '/interface/2017Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2017.xml.xhtml'
    )),
    ('2018_1', PapResource(
        '/interface/2018Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2018.xml.xhtml'
    )),
    ('2019_1', PapResource(
        '/interface/2019Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2019.xml.xhtml'
    )),
    ('2020_1', PapResource(
        '/interface/2020Version1.xhtml',
        '/javax.faces.resource/daten/xmls/Lohnsteuer2020.xml.xhtml'
    )),
))


def get_pap_xml(pap_resource_name):
    """ Fetch PAP XML from bmf-steuerrechner.de and return
        it as a string.
    """
    resource = PAP_RESOURCES.get(pap_resource_name)
{'fraction_non_alphanumeric': 0.15196478069460298, 'fraction_numerical': 0.07549323332789826, 'mean_word_length': 2.9370988446726574, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 74}, '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': '2168947', 'n_tokens_mistral': 2509, 'n_tokens_neox': 2103, 'n_words': 226}