<commit_before>from json import loads
from requests import Session
from datetime import datetime as dt

API_URL = 'http://www.netcodepool.org/oldapi.php?api_key={0}'


class NetCodePoolAPI:
    def __init__(self, key):
        self.key = key
        self.sesh = Session()
        self.refresh()

    def refresh(self):
        """Updates the internal data"""
        content = loads(self.sesh.get(API_URL.format(self.key)).content)
        self.data = {
            'stats': {
                'username': content['username'],
                'rewards': content['username'],
                'hashrate': content['total_hashrate'],
                'history': content['payout_history'],<commit_msg>Make hashrate of type int<commit_after>from json import loads
from requests import Session
from datetime import datetime as dt

API_URL = 'http://www.netcodepool.org/oldapi.php?api_key={0}'


class NetCodePoolAPI:
    def __init__(self, key):
        self.key = key
        self.sesh = Session()
        self.refresh()

    def refresh(self):
        """Updates the internal data"""
        content = loads(self.sesh.get(API_URL.format(self.key)).content)
        self.data = {
            'stats': {
                'username': content['username'],
                'rewards': content['username'],
                'hashrate': int(content['total_hashrate']),
                'history': content['payout_history'],
{'fraction_non_alphanumeric': 0.1309608540925267, 'fraction_numerical': 0.0014234875444839859, 'mean_word_length': 2.4545454545454546, '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': '2411801', 'n_tokens_mistral': 402, 'n_tokens_neox': 390, 'n_words': 91}