<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def AddUserAccount(self, user_account, session_identifier=CURRENT_SESSION):
 """Adds an user account. Args: user_account (UserAccountArtifact):
 user account artifact. session_identifier (Optional[str])):
 session identifier, where CURRENT_SESSION represents the active session. Raises: KeyError: if the user account already exists. """

    if session_identifier not in self._user_accounts:
      self._user_accounts[session_identifier] = {}

    user_accounts = self._user_accounts[session_identifier]
    if user_account.identifier in user_accounts:
      raise KeyError('User account: {0:s} already exists.'.format(
          user_account.identifier))

    user_accounts[user_account.identifier] = user_account