def convert_sbml_model(model):
biomass_reactions = set()<EOL>for reaction in model.reactions:<EOL><INDENT>if reaction.id not in model.limits:<EOL><INDENT>lower, upper = parse_flux_bounds(reaction)<EOL>if lower is not None or upper is not None:<EOL><INDENT>model.limits[reaction.id] = reaction.id, lower, upper<EOL><DEDENT><DEDENT>objective = parse_objective_coefficient(reaction)<EOL>if objective is not None and objective != <NUM_LIT:0>:<EOL><INDENT>biomass_reactions.add(reaction.id)<EOL><DEDENT><DEDENT>if len(biomass_reactions) == <NUM_LIT:1>:<EOL><INDENT>model.biomass_reaction = next(iter(biomass_reactions))<EOL><DEDENT>convert_model_entries(model)<EOL>if model.extracellular_compartment is None:<EOL><INDENT>extracellular = detect_extracellular_compartment(model)<EOL>model.extracellular_compartment = extracellular<EOL><DEDENT>convert_exchange_to_compounds(model)<EOL>
Convert raw SBML model to extended model.

    Args:
        model: :class:`NativeModel` obtained from :class:`SBMLReader`.