code: def _tot_services_by_state(self, services, state):
          
          return str(sum(1 for s in self.services
                         if services[s].state_id == state))
docs: Get the number of service in the specified state
  
          :param state: state to filter service
          :type state:
          :return: number of service with s.state_id == state
          :rtype: int