'Returns the number of waiting targets an agent has.'

def count_waiting_targets(self, agentid):

    agent = self.get_agent(agentid)
    return sum((len(os.listdir(self.get_local_path(agent, path))) for path in ['input', os.path.join('remote', 'input')]))
