def parse_mtestfile(fname):
 with open(fname) as fp:
  for line in fp:
   if ('--' in line):
    line = line[:line.index('--')]
   if (not line.strip()):
    continue
   (lhs, rhs) = line.split('->')
   (id, fn, arg) = lhs.split()
   rhs_pieces = rhs.split()
   exp = rhs_pieces[0]
   flags = rhs_pieces[1:]
   (yield (id, fn, float(arg), float(exp), flags))

def parse_mtestfile ( fname ) : with open ( fname ) as fp : for line in fp : if ( '--' in line ) : line = line [ : line . index ( '--' ) ] if ( not line . strip ( ) ) : continue ( lhs , rhs ) = line . split ( '->' ) ( id , fn , arg ) = lhs . split ( ) rhs_pieces = rhs . split ( ) exp = rhs_pieces [ 0 ] flags = rhs_pieces [ 1 : ] ( yield ( id , fn , float ( arg ) , float ( exp ) , flags ) )
parse a file with test values -- starts a comment blank lines .