def logout(self, subject):
if (subject is None):<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg)<EOL><DEDENT>self.before_logout(subject)<EOL>identifiers = copy.copy(subject.identifiers)   <EOL>if (identifiers):<EOL><INDENT>msg = ("<STR_LIT>".format(<EOL>identifiers.primary_identifier))<EOL>logger.debug(msg)<EOL><DEDENT>try:<EOL><INDENT>self.delete(subject)<EOL><DEDENT>except Exception:<EOL><INDENT>msg = "<STR_LIT>"<EOL>logger.debug(msg, exc_info=True)<EOL><DEDENT>finally:<EOL><INDENT>try:<EOL><INDENT>self.stop_session(subject)<EOL><DEDENT>except Exception:<EOL><INDENT>msg2 = ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL>logger.debug(msg2, exc_info=True)<EOL><DEDENT><DEDENT>
Logs out the specified Subject from the system.

Note that most application developers should not call this method unless
they have a good reason for doing so.  The preferred way to logout a
Subject is to call ``Subject.logout()``, not by calling ``SecurityManager.logout``
directly. However, framework developers might find calling this method
directly useful in certain cases.

:param subject the subject to log out:
:type subject:  subject_abcs.Subject