docs: def merge_identity(self, subject):
          """
          Merges the Subject's identifying attributes (principals) and authc status
          into the Subject's session
  
          :type subject:  subject_abcs.Subject
          """
          current_identifiers = None
  
          if subject.is_run_as:
              # avoid the other steps of attribute access when referencing by
              # property by referencing the underlying attribute directly:
              current_identifiers = subject._identifiers
  
          if not current_identifiers:
              # if direct attribute access did not work, use the property-
              # decorated attribute access method:
              current_identifiers = subject.identifiers
  
          session = subject.get_session(False)
  
          if not session:
              to_set = []
  
              if current_identifiers or subject.authenticated:
                  session = subject.get_session()
  
                  to_set.append([self.dsc_isk, current_identifiers])
                  to_set.append([self.dsc_ask, True])
  
                  msg = ('merge_identity _DID NOT_ find a session for current subject '
                         'and so created a new one (session_id: {0}). Now merging '
                         'internal attributes: {1}'.format(session.session_id, to_set))
                  logger.debug(msg)
                  session.set_internal_attributes(to_set)
          else:
              self.merge_identity_with_session(current_identifiers, subject, session)