'Calculate current load of the compute host based on
task states.'

def calculate_workload(self):

    current_workload = 0
    for k in self:
        if (k.startswith('num_task') and (not k.endswith('None'))):
            current_workload += self[k]
    return current_workload
