<commit_before>import re

def get_result(output):
  output = "".join([line for line in output.splitlines() if not line.startswith("Parsing") and not line.startswith("Solver")])
  
  try:
    lst = eval(output, {'inf':float('inf')})
  except:
    print(output)
    return float('nan')

  if type(lst[0]) is list:
    return lst[0][1]
  else:
    return lst[0]

  <commit_msg>better support for parsing gelpia's output<commit_after>import re

def get_result(output):
  output = "".join([line for line in output.splitlines() if not line.startswith("Parsing") and not line.startswith("Solver")])
  output = output.replace("Stopping early...","")
  
  try:
    lst = eval(output, {'inf':float('inf')})
  except:
    print(output)
    return float('nan')

  if type(lst[0]) is list:
    return lst[0][1]
  else:
    return lst[0]

  
{'fraction_non_alphanumeric': 0.1608222490931076, 'fraction_numerical': 0.009673518742442563, 'mean_word_length': 3.8705882352941177, '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': '2458061', 'n_tokens_mistral': 300, 'n_tokens_neox': 290, 'n_words': 74}