<commit_before>import sys, os

class SniperStatsBase:
  def parse_stats(self, (k1, k2), ncores):
    v1 = self.read_snapshot(k1)
    v2 = self.read_snapshot(k2)
    results = []
    for metricid, list in v2.items():
      name = '%s.%s' % self.names[metricid]
      for idx in range(min(0, min(list.keys() or [0])), max(ncores, max(list.keys() or [0])+1)):
        val1 = v1.get(metricid, {}).get(idx, 0)
        val2 = v2.get(metricid, {}).get(idx, 0)
        results.append((name, idx, val2 - val1))
        if name == 'performance_model.elapsed_time' and idx < ncores:<commit_msg>[PATCH 62/85] [stats] parse_stats: return results for everything in self.names (all keys), which may be more than those defined in snapshot 2<commit_after>import sys, os

class SniperStatsBase:
  def parse_stats(self, (k1, k2), ncores):
    v1 = self.read_snapshot(k1)
    v2 = self.read_snapshot(k2)
    results = []
    for metricid in self.names.keys():
      name = '%s.%s' % self.names[metricid]
      id_min = min(min(v2.get(metricid, {}).keys() or [0]), 0)
      id_max = max(max(v2.get(metricid, {}).keys() or [0])+1, ncores)
      for idx in range(id_min, id_max):
        val1 = v1.get(metricid, {}).get(idx, 0)
        val2 = v2.get(metricid, {}).get(idx, 0)
        results.append((name, idx, val2 - val1))
        if name == 'performance_model.elapsed_time' and idx < ncores:
{'fraction_non_alphanumeric': 0.1648431801604668, 'fraction_numerical': 0.032093362509117436, 'mean_word_length': 3.234567901234568, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2933882', 'n_tokens_mistral': 533, 'n_tokens_neox': 516, 'n_words': 129}