def get_var(self, name, user=None):
<EOL>if user is not None:<EOL><INDENT>if user not in self._users:<EOL><INDENT>raise UserNotDefinedError<EOL><DEDENT>return self._users[user].get_var(name)<EOL><DEDENT>if name not in self._global_vars:<EOL><INDENT>raise VarNotDefinedError<EOL><DEDENT>return self._global_vars[name]<EOL>
Retrieve a global or user variable
:param name: The name of the variable to retrieve
:type  name: str

:param user: If retrieving a user variable, the user identifier
:type  user: str or None

:rtype: str

:raises UserNotDefinedError: The specified user does not exist
:raises VarNotDefinedError: The requested variable has not been defined