docs: def pop_identity(self):
          """
          :returns: SimpleIdentifierCollection
          """
          popped = None
          stack = self.get_run_as_identifiers_stack()
  
          if (stack):
              popped = stack.pop()
              if (stack):
                  # persist the changed stack to the session
                  session = self.get_session()
                  session.set_internal_attribute(self.run_as_identifiers_session_key, stack)
  
              else:
                  # stack is empty, remove it from the session:
                  self.clear_run_as_identities()
          return popped