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

Function build_profile_map

experiments/baselines/scinup_strict/runner.py:216–234  ·  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

214
215
216def build_profile_map(
217 user_metadata: Dict[str, Dict[str, Any]],
218 roles: Dict[str, Dict[str, Any]],
219 episode_rows: Sequence[Dict[str, Any]],
220) -> Dict[str, Dict[str, Any]]:
221 user_ids = sorted(
222 {
223 str(row.get("user_id") or "").strip()
224 for row in episode_rows
225 if str(row.get("user_id") or "").strip()
226 }
227 | set(user_metadata.keys())
228 )
229 profiles: Dict[str, Dict[str, Any]] = {}
230 for user_id in user_ids:
231 meta = user_metadata.get(user_id, {})
232 role_name = str(meta.get("role_name") or user_id.replace("user_", "")).strip()
233 profiles[user_id] = build_query_profile(meta, roles.get(role_name, {}))
234 return profiles
235
236
237def group_by_episode(rows: Sequence[Dict[str, Any]]) -> Dict[str, List[Dict[str, Any]]]:

Callers 1

rerank_episodesFunction · 0.70

Calls 2

build_query_profileFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected