def read_header(ofile):
i = next(ofile)<EOL>while r_comment.match(i):<EOL><INDENT>i = next(ofile)<EOL><DEDENT>relation = None<EOL>attributes = []<EOL>while not r_datameta.match(i):<EOL><INDENT>m = r_headerline.match(i)<EOL>if m:<EOL><INDENT>isattr = r_attribute.match(i)<EOL>if isattr:<EOL><INDENT>name, type, i = tokenize_attribute(ofile, i)<EOL>attributes.append((name, type))<EOL><DEDENT>else:<EOL><INDENT>isrel = r_relation.match(i)<EOL>if isrel:<EOL><INDENT>relation = isrel.group(<NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>" % i)<EOL><DEDENT>i = next(ofile)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>i = next(ofile)<EOL><DEDENT><DEDENT>return relation, attributes<EOL>
Read the header of the iterable ofile.