code: async def update_state(self, short_name, state):
          
  
          if short_name not in self.services:
              raise ArgumentError("Service name is unknown", short_name=short_name)
  
          if state not in states.KNOWN_STATES:
              raise ArgumentError("Invalid service state", state=state)
  
          serv = self.services[short_name]['state']
  
          if serv.state == state:
              return
  
          update = {}
          update['old_status'] = serv.state
          update['new_status'] = state
          update['new_status_string'] = states.KNOWN_STATES[state]
  
          serv.state = state
          await self._notify_update(short_name, 'state_change', update)
docs: Set the current state of a service.
  
          If the state is unchanged from a previous attempt, this routine does
          nothing.
  
          Args:
              short_name (string): The short name of the service
              state (int): The new stae of the service