code: def _tot_services_by_state(self, state=None, state_type=None):
          
          if state is None and state_type is None:
              return len(self.services)
          if state_type:
              return sum(1 for s in self.services if s.state == state and s.state_type == state_type)
          return sum(1 for s in self.services if s.state == state)
docs: Generic function to get the number of services in the specified state
  
          :param state: state to filter on
          :type state: str
          :param state_type: state type to filter on (HARD, SOFT)
          :type state_type: str
          :return: number of host in state *state*
          :rtype: int
          TODO: Should be moved