def _check_required(sbase, value, attribute):
if (value is None) or (value == "<STR_LIT>"):<EOL><INDENT>msg = "<STR_LIT>" %(attribute, sbase)<EOL>if hasattr(sbase, "<STR_LIT>") and sbase.getId():<EOL><INDENT>msg += "<STR_LIT>" % sbase.getId()<EOL><DEDENT>elif hasattr(sbase, "<STR_LIT>") and sbase.getName():<EOL><INDENT>msg += "<STR_LIT>" % sbase.getName()<EOL><DEDENT>elif hasattr(sbase, "<STR_LIT>") and sbase.getMetaId():<EOL><INDENT>msg += "<STR_LIT>" % sbase.getName()<EOL><DEDENT>raise CobraSBMLError(msg)<EOL><DEDENT>return value<EOL>
Get required attribute from SBase.

    Parameters
    ----------
    sbase : libsbml.SBase
    value : existing value
    attribute: name of attribute

    Returns
    -------
    attribute value (or value if already set)