code: def login(self, username, password):
          
          finvars = self.clientvars
          if username and password:
              finvars['username'] = username
              finvars['password'] = password
              self.loggedin = True
              ret = self.send_command('login', ujson.dumps(finvars))
              if not isinstance(ret, str):  # should just be 'Ok'
                  if self.loggedin:
                      self.loggedin = False
                      raise UserLoginFailed(ret['msg'])
                  else:
                      raise GeneralLoginError(ret['msg'])
docs: This handles login logic instead of stuffing all that in the __init__.
  
          :param username: The username to log in as or None
          :param password: The password for that user or None
          :return: Nothing
          :raises: :class:`Pymoe.errors.UserLoginFailed` - Didn't respond with Ok
          :raises: :class:`Pymoe.errors.GeneralLoginError` - For some reason, we were already logged in, tried to login again and it failed. This probably isn't bad.