(profile)
| 15010 | return any(t in s for t in generic_tokens) |
| 15011 | |
| 15012 | def _pick_profile_name(profile): |
| 15013 | if not isinstance(profile, dict): |
| 15014 | return "" |
| 15015 | candidate = profile.get("fullName") or profile.get("full_name") or profile.get("displayName") |
| 15016 | if isinstance(candidate, str): |
| 15017 | candidate = candidate.strip() |
| 15018 | if candidate and _norm_text(candidate) not in noisy_labels and _norm_text(candidate) not in {"n/a"}: |
| 15019 | return candidate |
| 15020 | candidate = profile.get("name") or profile.get("title") |
| 15021 | if isinstance(candidate, str): |
| 15022 | candidate = candidate.strip() |
| 15023 | if candidate and _norm_text(candidate) not in noisy_labels and _norm_text(candidate) not in {"n/a"}: |
| 15024 | return candidate |
| 15025 | first = str(profile.get("firstName") or "").strip() |
| 15026 | last = str(profile.get("lastName") or "").strip() |
| 15027 | if first or last: |
| 15028 | full = " ".join([x for x in (first, last) if x]).strip() |
| 15029 | if full: |
| 15030 | return full |
| 15031 | return "" |
| 15032 | |
| 15033 | def _looks_noisy_profile(profile): |
| 15034 | if not isinstance(profile, dict): |
nothing calls this directly
no outgoing calls
no test coverage detected