<commit_before>import sys
import taxon

## run this as a script
if __name__ == "__main__":
    ids=['1211997']
    if len(sys.argv) == 1:
        print "Supply your own id for the tree. Here is an example"
    else:
        ids=sys.argv[1:]

    taxa = taxon.readNodes()
    names,blastname = taxon.readNames()
    divs = taxon.readDivisions()
    for i in ids:
        c=0
        if i not in taxa:
            sys.stderr.write("Error: ID " + str(i) + " was not found in the taxonomy filei\n")
            sys.exit(0)
        while taxa[i].parent != '1' and i != '1':
            #print " " * c, taxa[i].taxid, "name:", names[i].name, "rank:", taxa[i].rank, "div:", taxa[i].division, "code:", divs[taxa[i].division].code
            bn=names[i].name
            if i in blastname:
                bn=blastname[i].name
            print taxa[i].taxid, "name:", names[i].name, "blast name", bn, "rank:", taxa[i].rank, "parent: ", taxa[i].parent
            i=taxa[i].parent
            c+=1
        print
<commit_msg>Converting to python3<commit_after>import sys
import taxon

## run this as a script
if __name__ == "__main__":
    ids=['1211997']
    if len(sys.argv) == 1:
        print("Supply your own id for the tree. Here is an example")
    else:
        ids=sys.argv[1:]

    taxa = taxon.read_nodes()
    names,blastname = taxon.read_names()
    divs = taxon.read_divisions()
    for i in ids:
        c=0
        if i not in taxa:
            sys.stderr.write("Error: ID " + str(i) + " was not found in the taxonomy filei\n")
            sys.exit(0)
        while taxa[i].parent != '1' and i != '1':
            #print " " * c, taxa[i].taxid, "name:", names[i].name, "rank:", taxa[i].rank, "div:", taxa[i].division, "code:", divs[taxa[i].division].code
            bn=names[i].name
            if i in blastname:
                bn=blastname[i].name
            print("{} name: {}    blast name: {}   rank: {}   parent: {}".format(taxa[i].taxid, names[i].name, bn, taxa[i].rank, taxa[i].parent))
            i=taxa[i].parent
            c+=1


{'fraction_non_alphanumeric': 0.16374269005847952, 'fraction_numerical': 0.014132553606237816, 'mean_word_length': 2.1487730061349692, 'pattern_counts': {'":': 2, '<': 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': '5239322', 'n_tokens_mistral': 750, 'n_tokens_neox': 703, 'n_words': 188}