MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / cb

Function cb

crates/pyhq/python/hyperqueue/client.py:125–142  ·  view source on GitHub ↗
(jobs)

Source from the content-addressed store, hash-verified

123 bar = None
124
125 def cb(jobs):
126 nonlocal bar
127
128 if bar is None:
129 total_tasks = sum(s["total"] for s in jobs.values())
130 bar = tqdm(total=total_tasks, unit="task")
131
132 job_count = len(jobs)
133 completed = sum(1 if s["completed"] else 0 for s in jobs.values())
134
135 job_text = pluralize("job", job_count)
136 bar.set_postfix_str(f"{completed}/{job_count} {job_text} completed")
137
138 finished_tasks = sum(s["finished"] for s in jobs.values())
139
140 delta = finished_tasks - bar.n
141 if delta:
142 bar.update(delta)
143
144 return cb

Callers

nothing calls this directly

Calls 3

valuesMethod · 0.80
pluralizeFunction · 0.50
updateMethod · 0.45

Tested by

no test coverage detected