parameters: (self, mode: ClientMode)
return_statement: return True
docstring: Switches running mode of simulation client and return if mode changed.
docstring_summary: Switches running mode of simulation client and return if mode changed.
docstring_tokens: Switches running mode of simulation client and return if mode changed .
function: def switch_mode(self, mode: ClientMode) -> bool:
      """Switches running mode of simulation client and return if mode changed."""
      if mode not in (ClientMode.CONFIGURATION, ClientMode.SIMULATION):
        raise ValueError(f"Invalid client mode {mode}.")
      if mode == self._client_mode:
        return False
      self._client_mode = mode
      return True
function_tokens: def switch_mode ( self , mode : ClientMode ) -> bool : if mode not in ( ClientMode . CONFIGURATION , ClientMode . SIMULATION ) : raise ValueError ( f"Invalid client mode {mode}." ) if mode == self . _client_mode : return False self . _client_mode = mode return True