def load_sbml(filename):
import libsbml<EOL>document = libsbml.readSBML(filename)<EOL>document.validateSBML()<EOL>num_errors = (document.getNumErrors(libsbml.LIBSBML_SEV_ERROR)<EOL>+ document.getNumErrors(libsbml.LIBSBML_SEV_FATAL))<EOL>if num_errors > <NUM_LIT:0>:<EOL><INDENT>messages = "<STR_LIT>"<EOL>messages += "<STR_LIT>".format(num_errors)<EOL>for i in range(document.getNumErrors(libsbml.LIBSBML_SEV_ERROR)):<EOL><INDENT>err = document.getErrorWithSeverity(i, libsbml.LIBSBML_SEV_ERROR)<EOL>messages += "<STR_LIT>".format(err.getSeverityAsString(), err.getShortMessage())<EOL><DEDENT>for i in range(document.getNumErrors(libsbml.LIBSBML_SEV_FATAL)):<EOL><INDENT>err = document.getErrorWithSeverity(i, libsbml.LIBSBML_SEV_FATAL)<EOL>messages += "<STR_LIT>".format(err.getSeverityAsString(), err.getShortMessage())<EOL><DEDENT>raise RuntimeError(messages)<EOL><DEDENT>return import_sbml(document)<EOL>
Load a model from a SBML file.

Parameters
----------
filename : str
    The input SBML filename.

Returns
-------
model : NetworkModel
y0 : dict
    Initial condition.
volume : Real or Real3, optional
    A size of the simulation volume.