<commit_before>from json import JSONEncoder

class Measurement(JSONEncoder):
  def __init__(self, value, name=None, source=None, measure_time=None):
    self.value        = value
    self.name         = name
    self.source       = source
    self.measure_time = measure_time

  def default(self, o):
    return o.__dict__<commit_msg>No need to inherit JSON, we use .__dict__ instead.<commit_after>class Measurement(object):
  def __init__(self, value, name=None, source=None, measure_time=None):
    self.value        = value
    self.name         = name
    self.source       = source
    self.measure_time = measure_time
{'fraction_non_alphanumeric': 0.0898876404494382, 'fraction_numerical': 0.0, 'mean_word_length': 3.0784313725490198, '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': '2451217', 'n_tokens_mistral': 186, 'n_tokens_neox': 180, 'n_words': 48}