def read_header(ofile):
 i = next(ofile)
 while r_comment.match(i):
  i = next(ofile)
 relation = None
 attributes = []
 while (not r_datameta.match(i)):
  m = r_headerline.match(i)
  if m:
   isattr = r_attribute.match(i)
   if isattr:
    (name, type, i) = tokenize_attribute(ofile, i)
    attributes.append((name, type))
   else:
    isrel = r_relation.match(i)
    if isrel:
     relation = isrel.group(1)
    else:
     raise ValueError(('Error parsing line %s' % i))
    i = next(ofile)
  else:
   i = next(ofile)
 return (relation, attributes)

def read_header ( ofile ) : i = next ( ofile ) while r_comment . match ( i ) : i = next ( ofile ) relation = None attributes = [ ] while ( not r_datameta . match ( i ) ) : m = r_headerline . match ( i ) if m : isattr = r_attribute . match ( i ) if isattr : ( name , type , i ) = tokenize_attribute ( ofile , i ) attributes . append ( ( name , type ) ) else : isrel = r_relation . match ( i ) if isrel : relation = isrel . group ( 1 ) else : raise ValueError ( ( 'Error parsing line %s' % i ) ) i = next ( ofile ) else : i = next ( ofile ) return ( relation , attributes )
parameters f : file or gzip .