<commit_before>#
# (C) Copyright 2012-2013 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.

# make the python3-like print behave in python 2
from __future__ import print_function

import os
import sys
import time
import traceback
from contextlib import closing

# python 2 and 3 compatible urllib and httplib imports
try:
    from urllib.parse import urlparse
    from urllib.parse import urljoin
    from urllib.error import HTTPError, URLError
    from urllib.request import HTTPRedirectHandler, Request, build_opener, urlopen, addinfourl
    from http.client import BadStatusLine
except ImportError:
    from urlparse import urlparse
    from urlparse import urljoin
    from urllib2 import HTTPError, URLError
    from urllib2 import HTTPRedirectHandler, Request, build_opener, urlopen, addinfourl
    from httplib import BadStatusLine

try:
    import json
except ImportError:
    import simplejson as json

try:
    import ssl
except ImportError:
    print("Python socket module was not compiled with SSL support. Aborting...")
    sys.exit(1)


###############################################################################
VERSION = '1.5.2'

###############################################################################


class APIKeyFetchError(Exception):
    pass


def _get_apikey_from_environ():
    try:
        key = os.environ["ECMWF_API_KEY"]
        url = os.environ["ECMWF_API_URL"]
        email = os.environ["ECMWF_API_EMAIL"]<commit_msg>Version 1.5.3<commit_after>#
# (C) Copyright 2012-2013 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation nor
# does it submit to any jurisdiction.

# make the python3-like print behave in python 2
from __future__ import print_function

import os
import sys
import time
import traceback
from contextlib import closing

# python 2 and 3 compatible urllib and httplib imports
try:
    from urllib.parse import urlparse
    from urllib.parse import urljoin
    from urllib.error import HTTPError, URLError
    from urllib.request import HTTPRedirectHandler, Request, build_opener, urlopen, addinfourl
    from http.client import BadStatusLine
except ImportError:
    from urlparse import urlparse
    from urlparse import urljoin
    from urllib2 import HTTPError, URLError
    from urllib2 import HTTPRedirectHandler, Request, build_opener, urlopen, addinfourl
    from httplib import BadStatusLine

try:
    import json
except ImportError:
    import simplejson as json

try:
    import ssl
except ImportError:
    print("Python socket module was not compiled with SSL support. Aborting...")
    sys.exit(1)


###############################################################################
VERSION = '1.5.3'

###############################################################################


class APIKeyFetchError(Exception):
    pass


def _get_apikey_from_environ():
    try:
        key = os.environ["ECMWF_API_KEY"]
        url = os.environ["ECMWF_API_URL"]
        email = os.environ["ECMWF_API_EMAIL"]
{'fraction_non_alphanumeric': 0.14245336348219334, 'fraction_numerical': 0.013284341435839458, 'mean_word_length': 4.378419452887538, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1016284', 'n_tokens_mistral': 1037, 'n_tokens_neox': 985, 'n_words': 360}