

def extract_list(file, tag, hash_results):
    F = open(file, 'r')
    Flag = False
    for line in F:
        if line.startswith(tag):
            Flag = True
            label = line[:(- 1)].split('\t')[1]
            continue
        if Flag:
            fields = line[:(- 1)].split('\t')
            name = fields[0]
            hash_results[name][label] = fields[1]
    F.close()
    return label

dataset/ETHPy150Open ARTbio/tools-artbio/unstable/local_tools/hit_list_aggregater.py extract_list/original