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

:param value: The value of the variable to set
:type  value: str

:param user: If defining a user variable, the user identifier
:type  user: str

:raises UserNotDefinedError: The specified user does not exist