def parse_exchange(exchange_def, default_compartment):
default_compartment = exchange_def.get('<STR_LIT>', default_compartment)<EOL>for compound_def in exchange_def.get('<STR_LIT>', []):<EOL><INDENT>compartment = compound_def.get('<STR_LIT>', default_compartment)<EOL>compound = Compound(compound_def['<STR_LIT:id>'], compartment=compartment)<EOL>reaction = compound_def.get('<STR_LIT>')<EOL>lower, upper = get_limits(compound_def)<EOL>yield compound, reaction, lower, upper<EOL><DEDENT>
Parse a structured exchange definition as obtained from a YAML file.

    Returns in iterator of compound, reaction, lower and upper bounds.