<commit_before>#!/usr/bin/env python
from __future__ import print_function
import json
import re
import sys
from bisect import bisect
from datetime import datetime
from datetime import timedelta

try:
    from urllib.request import urlopen
except ImportError:
    from urllib import urlopen

from pip.commands.uninstall import UninstallCommand
from pip.commands.install import InstallCommand
from pip import get_installed_distributions


def get_releases(package_name):
    url = 'http://pypi.python.org/pypi/%s/json' % package_name
    return json.loads(urlopen(url).read().decode('utf8'))['releases']


def parse_iso8601(s):<commit_msg>fix weird windows ssl issues<commit_after>#!/usr/bin/env python
from __future__ import print_function
import json
import re
import sys
from bisect import bisect
from datetime import datetime
from datetime import timedelta
import ssl

try:
    from urllib.request import Request, build_opener, HTTPSHandler, URLError
except ImportError:
    from urllib2 import Request, build_opener, HTTPSHandler, URLError

from pip.commands.uninstall import UninstallCommand
from pip.commands.install import InstallCommand
from pip import get_installed_distributions


def get_releases(package_name):
    url = 'https://pypi.python.org/pypi/%s/json' % package_name

    ssl_context = HTTPSHandler(
        context=ssl.SSLContext(ssl.PROTOCOL_TLSv1))
    opener = build_opener(ssl_context)

    retries = 10
    while retries > 0:
        try:
            r = opener.open(Request(url))
            break
        except URLError:
            retries -= 1

    return json.loads(r.read().decode('utf8'))['releases']


def parse_iso8601(s):
{'fraction_non_alphanumeric': 0.07840772014475271, 'fraction_numerical': 0.009650180940892641, 'mean_word_length': 4.2834394904458595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 1, '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': '6455598', 'n_tokens_mistral': 527, 'n_tokens_neox': 488, 'n_words': 141}