<commit_before>#!/usr/bin/python
#
# Usage: ./cldr_territories_en_to_py.py de de_CH > countries.py

from xml.etree import ElementTree


xml = ElementTree.fromstring(open('common/main/en.xml').read())

print '''# coding=utf-8

from django.utils.translation import ugettext_lazy as _


countries = {'''

for t in xml.findall('localeDisplayNames/territories/territory'):
    print ('    \'%s\': _(\'%s\'),' % (t.attrib['type'], t.text.replace('\'', '\\\''))).encode('utf-8')

print '}'
<commit_msg>Adapt scripts to last change by guetux<commit_after>#!/usr/bin/python
#
# Usage: ./cldr_territories_en_to_py.py de de_CH > countries.py

from xml.etree import ElementTree


xml = ElementTree.fromstring(open('common/main/en.xml').read())

print '''# coding=utf-8

from django.utils.translation import ugettext_lazy as _


countries = {'''

for t in xml.findall('localeDisplayNames/territories/territory'):
    print ('    \'%s\': _(u\'%s\'),' % (t.attrib['type'], t.text.replace('\'', '\\\''))).encode('utf-8')

print '}'

{'fraction_non_alphanumeric': 0.20275590551181102, 'fraction_numerical': 0.003937007874015748, 'mean_word_length': 4.438502673796791, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '897318', 'n_tokens_mistral': 392, 'n_tokens_neox': 375, 'n_words': 68}