<commit_before>from sys import version_info
if version_info[0] >= 3:
    from urllib.parse import urlencode
    from urllib.request import Request, urlopen
else:
    from urllib import urlencode
    from urllib2 import Request, urlopen

import fred.config as c
from json import loads
from pandas import DataFrame

def _fetch(url):
    """
    Helper funcation to fetch content from a given url.
    """
    req = Request(url)
    page = urlopen(req)
    content = page.read()
    page.close()<commit_msg>Fix json parsing error in Python 3<commit_after>from sys import version_info
if version_info[0] >= 3:
    from urllib.parse import urlencode
    from urllib.request import Request, urlopen
else:
    from urllib import urlencode
    from urllib2 import Request, urlopen

import fred.config as c
from json import loads
from pandas import DataFrame

def _fetch(url):
    """
    Helper funcation to fetch content from a given url.
    """
    req = Request(url)
    page = urlopen(req)
    content = page.read().decode('utf-8')
    page.close()
{'fraction_non_alphanumeric': 0.07655502392344497, 'fraction_numerical': 0.007655502392344498, 'mean_word_length': 3.451063829787234, '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': '7357207', 'n_tokens_mistral': 323, 'n_tokens_neox': 314, 'n_words': 117}