INNER CODE UNIT · Python

_activity_summary

i3T4AN/KADATH · kadath/cli.py:143

def _activity_summary(row: dict) -> str:
    try:
        payload = json.loads(row.get("payload_json") or "{}")
    except (TypeError, json.JSONDecodeError):
        payload = {}
    summary = payload.get("summary") or payload.get("outcome") or row.get("kind", "activity")
    return " ".join(str(summary).split())[:140]


def _render_dashboard(status: dict, styled: bool = False) -> str:
    run = status["run"]
    population = ", ".join(f"{row['status']}: {row['count']}" for row in status["population"])
    if styled:
        attempts = {row["status"]: int(row["count"]) for row in status.get("attempts", [])}
        total = int(run["population_size"])
        done = attempts.get("completed", 0)
        failed = attempts.get("failed", 0)
        resolved = min(total, done + failed)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…