MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / build_user_states

Function build_user_states

experiments/baselines/scholar_inbox/runner.py:615–635  ·  view source on GitHub ↗
(
    user_metadata: Dict[str, Dict[str, Any]],
    roles: Dict[str, Dict[str, Any]],
    episode_rows: Sequence[Dict[str, Any]],
)

Source from the content-addressed store, hash-verified

613
614
615def build_user_states(
616 user_metadata: Dict[str, Dict[str, Any]],
617 roles: Dict[str, Dict[str, Any]],
618 episode_rows: Sequence[Dict[str, Any]],
619) -> Dict[str, UserFeedbackState]:
620 user_ids = sorted(
621 {
622 str(row.get("user_id") or "").strip()
623 for row in episode_rows
624 if str(row.get("user_id") or "").strip()
625 }
626 | set(user_metadata.keys())
627 )
628 states: Dict[str, UserFeedbackState] = {}
629 for user_id in user_ids:
630 meta = user_metadata.get(user_id, {"user_id": user_id})
631 role_name = str(meta.get("role_name") or user_id.replace("user_", "")).strip()
632 role = roles.get(role_name, {})
633 profile = build_initial_profile(meta, role)
634 states[user_id] = UserFeedbackState(profile=profile, profile_text=make_profile_text(profile))
635 return states
636
637
638def clone_output_row(

Callers 1

rerank_episodesFunction · 0.70

Calls 4

UserFeedbackStateClass · 0.85
getMethod · 0.80
build_initial_profileFunction · 0.70
make_profile_textFunction · 0.70

Tested by

no test coverage detected