<commit_before># -*- coding: utf-8 -*-
# ###
# Copyright (c) 2013, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
import io
import re
import datetime
import json
import logging
try:
    import urllib2 # python2
except ImportError:
    import urllib.request as urllib2 # renamed in python3
try:
    import urlparse # python2
except ImportError:
    import urllib.parse as urlparse # renamed in python3

import cnxepub
from cnxepub.models import Document, DocumentPointer, TranslucentBinder
import requests
import tzlocal
from lxml import etree
from openstax_accounts.interfaces import IOpenstaxAccounts
from pyramid.threadlocal import get_current_registry, get_current_request
from cnxquerygrammar.query_parser import grammar, DictFormater
from parsimonious.exceptions import IncompleteParseError


# Timezone info initialized from the system timezone.
TZINFO = tzlocal.get_localzone()
logger = logging.getLogger('cnxauthoring')

PUBLISHING_ROLES_MAPPING = {
    'Author': 'authors',
    'Copyright Holder': 'licensors',
    'Editor': 'editors',
    'Illustrator': 'illustrators',
    'Publisher': 'publishers',
    'Translator': 'translators',
    }

NAMESPACES = (u'<body xmlns="http://www.w3.org/1999/xhtml" '
              'xmlns:bib="http://bibtexml.sf.net/" '
              'xmlns:data="http://dev.w3.org/html5/spec/#custom" '
              'xmlns:epub="http://www.idpf.org/2007/ops" '<commit_msg>Change data namespace. See also Connexions/rhaptos.cnxmlutils#132<commit_after># -*- coding: utf-8 -*-
# ###
# Copyright (c) 2013, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
import io
import re
import datetime
import json
import logging
try:
    import urllib2 # python2
except ImportError:
    import urllib.request as urllib2 # renamed in python3
try:
    import urlparse # python2
except ImportError:
    import urllib.parse as urlparse # renamed in python3

import cnxepub
from cnxepub.models import Document, DocumentPointer, TranslucentBinder
import requests
import tzlocal
from lxml import etree
from openstax_accounts.interfaces import IOpenstaxAccounts
from pyramid.threadlocal import get_current_registry, get_current_request
from cnxquerygrammar.query_parser import grammar, DictFormater
from parsimonious.exceptions import IncompleteParseError


# Timezone info initialized from the system timezone.
TZINFO = tzlocal.get_localzone()
logger = logging.getLogger('cnxauthoring')

PUBLISHING_ROLES_MAPPING = {
    'Author': 'authors',
    'Copyright Holder': 'licensors',
    'Editor': 'editors',
    'Illustrator': 'illustrators',
    'Publisher': 'publishers',
    'Translator': 'translators',
    }

NAMESPACES = (u'<body xmlns="http://www.w3.org/1999/xhtml" '
              'xmlns:bib="http://bibtexml.sf.net/" '
              'xmlns:data="http://www.w3.org/TR/html5/dom.html#custom-data-attribute" '
              'xmlns:epub="http://www.idpf.org/2007/ops" '
{'fraction_non_alphanumeric': 0.10338164251207729, 'fraction_numerical': 0.01642512077294686, 'mean_word_length': 4.300341296928328, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, 'xml': 13}, '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': '3059885', 'n_tokens_mistral': 1024, 'n_tokens_neox': 967, 'n_words': 265}