<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _tot_unhandled_hosts_by_state(self, state):
 """Generic function to get the number of unhandled problem hosts in the specified state :param state: state to filter on :type state: :return: number of host in state *state* and which are not acknowledged problems :rtype: int """

        return sum(1 for h in self.hosts if h.state == state and h.state_type == u'HARD' and
                   h.is_problem and not h.problem_has_been_acknowledged)