<commit_before>
from goatools.obo_parser import GODag
from goatools.obo_parser import GOTerm
import sys
from StringIO import StringIO

def chk_results(actual_paths, expected_paths):
  for actual_path in actual_paths:
    # GOTerm -> list of Strings
    actual = [GO.id for GO in actual_path] 
    if actual not in expected_paths:
      raise Exception('ACTUAL {} NOT FOUND IN EXPECTED RESULTS\n'.format(actual))

def test_paths_to_top(PRT=sys.stdout):
  dag = GODag("./data/mini_obo.obo")  
  expected_paths = [
    ['GO:0000001', 'GO:0000002', 'GO:0000005', 'GO:0000010'],
    ['GO:0000001', 'GO:0000003', 'GO:0000005', 'GO:0000010'],
    ['GO:0000001', 'GO:0000003', 'GO:0000006', 'GO:0000008', 'GO:0000010'] ]
  actual_paths = dag.paths_to_top("GO:0000010")
  chk_results(actual_paths, expected_paths)
      
<commit_msg>Removed unused lines<commit_after>
from goatools.obo_parser import GODag
import sys

def chk_results(actual_paths, expected_paths):
  for actual_path in actual_paths:
    # GOTerm -> list of Strings
    actual = [GO.id for GO in actual_path] 
    if actual not in expected_paths:
      raise Exception('ACTUAL {} NOT FOUND IN EXPECTED RESULTS\n'.format(actual))

def test_paths_to_top():
  dag = GODag("./data/mini_obo.obo")  
  expected_paths = [
    ['GO:0000001', 'GO:0000002', 'GO:0000005', 'GO:0000010'],
    ['GO:0000001', 'GO:0000003', 'GO:0000005', 'GO:0000010'],
    ['GO:0000001', 'GO:0000003', 'GO:0000006', 'GO:0000008', 'GO:0000010'] ]
  actual_paths = dag.paths_to_top("GO:0000010")
  chk_results(actual_paths, expected_paths)
      

{'fraction_non_alphanumeric': 0.1405852417302799, 'fraction_numerical': 0.12468193384223919, 'mean_word_length': 4.804428044280443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '321578', 'n_tokens_mistral': 720, 'n_tokens_neox': 556, 'n_words': 126}