<commit_before>import datetime
import operator
import time

from six.moves import urllib
from six import string_types
from six.moves import reduce

from stackexchange.web import WebRequestManager
from stackexchange.core import *

# Site constants
from stackexchange.sites import *

def or_none(o, k):
    try:
        return getattr(o, k)
    except:
        return None

##### Statistics    ###
class Statistics(JSONModel):
    """Stores statistics for a StackExchange site."""
    transfer = ('total_questions', 'total_unanswered', 'total_answers', 'total_comments', 'total_votes', 'total_badges', 'total_users', 'questions_per_minute', 'answers_per_minutes', 'badges_per_minute', 'display_name')

    def _extend(self, json, site):
        self.api_version = DictObject(json.api_version)

##### Content Types ###
class Answer(JSONModel):
    """Describes an answer on a StackExchange site."""

    transfer = ('is_accepted', 'locked_date', 'question_id', 'up_vote_count', 'down_vote_count', 'view_count', 'score',
        'community_owned', 'title', 'body')

    def _extend(self, json, site):
        self.id = json.answer_id
        self.accepted = self.is_accepted<commit_msg>Fix statistics<commit_after>import datetime
import operator
import time

from six.moves import urllib
from six import string_types
from six.moves import reduce

from stackexchange.web import WebRequestManager
from stackexchange.core import *

# Site constants
from stackexchange.sites import *

def or_none(o, k):
    try:
        return getattr(o, k)
    except:
        return None

##### Statistics    ###
class Statistics(JSONModel):
    """Stores statistics for a StackExchange site."""
    transfer = ('total_questions', 'total_unanswered', 'total_answers', 'total_comments', 'total_votes', 'total_badges', 'total_users', 'questions_per_minute', 'answers_per_minute', 'badges_per_minute', 'display_name')


##### Content Types ###
class Answer(JSONModel):
    """Describes an answer on a StackExchange site."""

    transfer = ('is_accepted', 'locked_date', 'question_id', 'up_vote_count', 'down_vote_count', 'view_count', 'score',
        'community_owned', 'title', 'body')

    def _extend(self, json, site):
        self.id = json.answer_id
        self.accepted = self.is_accepted
{'fraction_non_alphanumeric': 0.12230532336119665, 'fraction_numerical': 0.0, 'mean_word_length': 4.587223587223587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4707556', 'n_tokens_mistral': 725, 'n_tokens_neox': 693, 'n_words': 188}