def merge_identity(self, subject):
current_identifiers = None<EOL>if subject.is_run_as:<EOL><INDENT>current_identifiers = subject._identifiers<EOL><DEDENT>if not current_identifiers:<EOL><INDENT>current_identifiers = subject.identifiers<EOL><DEDENT>session = subject.get_session(False)<EOL>if not session:<EOL><INDENT>to_set = []<EOL>if current_identifiers or subject.authenticated:<EOL><INDENT>session = subject.get_session()<EOL>to_set.append([self.dsc_isk, current_identifiers])<EOL>to_set.append([self.dsc_ask, True])<EOL>msg = ('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(session.session_id, to_set))<EOL>logger.debug(msg)<EOL>session.set_internal_attributes(to_set)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.merge_identity_with_session(current_identifiers, subject, session)<EOL><DEDENT>
Merges the Subject's identifying attributes (principals) and authc status
into the Subject's session

:type subject:  subject_abcs.Subject