def parse_exchange_table_file(f):
for line in f:<EOL><INDENT>line, _, comment = line.partition('<STR_LIT:#>')<EOL>line = line.strip()<EOL>if line == '<STR_LIT>':<EOL><INDENT>continue<EOL><DEDENT>fields = line.split(None)<EOL>if len(fields) < <NUM_LIT:2> or len(fields) > <NUM_LIT:4>:<EOL><INDENT>raise ParseError('<STR_LIT>'.format(fields))<EOL><DEDENT>fields.extend(['<STR_LIT:->']*(<NUM_LIT:4>-len(fields)))<EOL>compound_id, compartment, lower, upper = fields<EOL>compound = Compound(compound_id, compartment)<EOL>lower = float(lower) if lower != '<STR_LIT:->' else None<EOL>upper = float(upper) if upper != '<STR_LIT:->' else None<EOL>yield compound, None, lower, upper<EOL><DEDENT>
Parse a space-separated file containing exchange compound flux limits.

    The first two columns contain compound IDs and compartment while the
    third column contains the lower flux limits. The fourth column is
    optional and contains the upper flux limit.