<commit_before># -*- coding: utf-8 -*-
"""
kay.i18n
~~~~~~~~~

Kay i18n tools.  This module provides various helpers for
internationalization.  That is a translation system (with an API,
compatible to standard gettext), timezone helpers as well as date
parsing and formatting functions.

General Architecture
--------------------

The i18n system is based on a few general principles.  Internally all
times are stored in UTC as naive datetime objects (that means no tzinfo
is present).  The internal language is American English and all text
information is stored as unicode strings.

For display strings are translated to the language of the blog and all
dates as converted to the blog timezone.

Translations are handled in a gettext inspired way via babel.  The
translatable strings are stored in POT and PO files and eventually
applications will reads translations from MO files.

Translation Workflow
--------------------

The extracting of strings is done with the `extract-messages`
script. The messages collected are stored in the `messages.pot`
file in the i18n folder of the project.

The actual translations have to be updated by hand with those strings.
The `update-translations` script will automatically add new strings to
the po files and try to do fuzzy matching.

To compile the translations into the MO files just use
`compile-translations`.

New languages are added with `add-translation`.

:Copyright: (c) 2009 Accense Technology, Inc. All rights reserved.
:copyright: (c) 2009 by the Zine Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.

This file is originally derived from Zine project.
"""

import os
from os import path
import cPickle as pickle
import struct
from gettext import NullTranslations
from datetime import datetime
from time import strptime
from weakref import WeakKeyDictionary

from pytz import timezone, UTC
from werkzeug.exceptions import NotFound
from werkzeug.urls import url_quote_plus
from werkzeug.utils import import_string

import kay
from kay import utils
from kay.utils import local
from kay.utils import url_for
from kay.conf import settings

__all__ = ['_', 'gettext', 'ngettext', 'lazy_gettext', 'lazy_ngettext']
<commit_msg>Removed unnecessary imports.<commit_after># -*- coding: utf-8 -*-
"""
kay.i18n
~~~~~~~~~

Kay i18n tools.  This module provides various helpers for
internationalization.  That is a translation system (with an API,
compatible to standard gettext), timezone helpers as well as date
parsing and formatting functions.

General Architecture
--------------------

The i18n system is based on a few general principles.  Internally all
times are stored in UTC as naive datetime objects (that means no tzinfo
is present).  The internal language is American English and all text
information is stored as unicode strings.

For display strings are translated to the language of the blog and all
dates as converted to the blog timezone.

Translations are handled in a gettext inspired way via babel.  The
translatable strings are stored in POT and PO files and eventually
applications will reads translations from MO files.

Translation Workflow
--------------------

The extracting of strings is done with the `extract-messages`
script. The messages collected are stored in the `messages.pot`
file in the i18n folder of the project.

The actual translations have to be updated by hand with those strings.
The `update-translations` script will automatically add new strings to
the po files and try to do fuzzy matching.

To compile the translations into the MO files just use
`compile-translations`.

New languages are added with `add-translation`.

:Copyright: (c) 2009 Accense Technology, Inc. All rights reserved.
:copyright: (c) 2009 by the Zine Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.

This file is originally derived from Zine project.
"""

import os
from os import path
import cPickle as pickle
import struct
from gettext import NullTranslations
from datetime import datetime
from time import strptime
from weakref import WeakKeyDictionary

from werkzeug.exceptions import NotFound
from werkzeug.urls import url_quote_plus
from werkzeug.utils import import_string

import kay
from kay import utils
from kay.utils import local
from kay.utils import url_for
from kay.conf import settings

__all__ = ['_', 'gettext', 'ngettext', 'lazy_gettext', 'lazy_ngettext']

{'fraction_non_alphanumeric': 0.06630336058128973, 'fraction_numerical': 0.007720254314259764, 'mean_word_length': 4.3136308805790105, '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': '6396754', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1125, 'n_words': 613}