def pop_identity(self):
popped = None<EOL>stack = self.get_run_as_identifiers_stack()<EOL>if (stack):<EOL><INDENT>popped = stack.pop()<EOL>if (stack):<EOL><INDENT>session = self.get_session()<EOL>session.set_internal_attribute(self.run_as_identifiers_session_key, stack)<EOL><DEDENT>else:<EOL><INDENT>self.clear_run_as_identities()<EOL><DEDENT><DEDENT>return popped<EOL>
:returns: SimpleIdentifierCollection