<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iter_tours(tourfile, frames=1):
 """ Extract tours from tourfile. Tourfile contains a set of contig configurations, generated at each iteration of the genetic algorithm. Each configuration has two rows, first row contains iteration id and score, second row contains list of contigs, separated by comma. """

    fp = open(tourfile)

    i = 0
    for row in fp:
        if row[0] == '>':
            label = row[1:].strip()
            if label.startswith("GA"):
                pf, j, score = label.split("-", 2)
                j = int(j)
            else:
                j = 0
            i += 1
        else:
            if j % frames != 0:
                continue
            tour, tour_o = separate_tour_and_o(row)
            yield i, label, tour, tour_o

    fp.close()