<commit_before># -*- coding: utf-8 -*-
'''
Nose tests
run as "nosetests tests"
    or "nosetests tests:test_main"
'''
import httplib2
try:
    from urllib.parse import urlencode
except ImportError:
    from urllib import urlencode
try:
    from urllib.parse import urlparse
except ImportError:
    from urlparse import urlparse
import json
import sys
import os
from nose.tools import ok_, eq_
try:
    import msgpack
except ImportError:
    sys.stderr.write("Warning: msgpack is not available.")
from biothings.tests.settings import NosetestSettings()

if sys.version_info.major >= 3:
    PY3 = True
else:
    PY3 = False

ns = NosetestSettings()
_d = json.loads    # shorthand for json decode
_e = json.dumps    # shorthand for json encode

try:
    jsonld_context = json.load(open(ns.jsonld_context_path, 'r'))
except:
    sys.stderr.write("Couldn't load JSON-LD context.")
    jsonld_context = {}


class BiothingTestHelper:
    def __init__(self):
        self.host = os.getenv(ns.nosetest_envar)<commit_msg>Stupid.<commit_after># -*- coding: utf-8 -*-
'''
Nose tests
run as "nosetests tests"
    or "nosetests tests:test_main"
'''
import httplib2
try:
    from urllib.parse import urlencode
except ImportError:
    from urllib import urlencode
try:
    from urllib.parse import urlparse
except ImportError:
    from urlparse import urlparse
import json
import sys
import os
from nose.tools import ok_, eq_
try:
    import msgpack
except ImportError:
    sys.stderr.write("Warning: msgpack is not available.")
from biothings.tests.settings import NosetestSettings

if sys.version_info.major >= 3:
    PY3 = True
else:
    PY3 = False

ns = NosetestSettings()
_d = json.loads    # shorthand for json decode
_e = json.dumps    # shorthand for json encode

try:
    jsonld_context = json.load(open(ns.jsonld_context_path, 'r'))
except:
    sys.stderr.write("Couldn't load JSON-LD context.")
    jsonld_context = {}


class BiothingTestHelper:
    def __init__(self):
        self.host = os.getenv(ns.nosetest_envar)
{'fraction_non_alphanumeric': 0.09474206349206349, 'fraction_numerical': 0.00496031746031746, 'mean_word_length': 3.7570754716981134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1969103', 'n_tokens_mistral': 677, 'n_tokens_neox': 659, 'n_words': 197}