def _check_id(entity, entity_type):
if entity is None:<EOL><INDENT>raise ParseError('<STR_LIT>'.format(entity_type))<EOL><DEDENT>elif not isinstance(entity, string_types):<EOL><INDENT>msg = '<STR_LIT>'.format(entity_type, entity)<EOL>if isinstance(entity, bool):<EOL><INDENT>msg += ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>raise ParseError(msg)<EOL><DEDENT>elif len(entity) == <NUM_LIT:0>:<EOL><INDENT>raise ParseError('<STR_LIT>'.format(entity_type))<EOL><DEDENT>
Check whether the ID is valid.

    First check if the ID is missing, and then check if it is a qualified
    string type, finally check if the string is empty. For all checks, it
    would raise a ParseError with the corresponding message.

    Args:
        entity: a string type object to be checked.
        entity_type: a string that shows the type of entities to check, usually
            `Compound` or 'Reaction'.