INNER CODE UNIT · Python

_ordered_intersection

LiuMengxuan04/shushu-internship-tool · skills/shushu-internship-tool/scripts/shushu_internship_tool/candidate_score.py:227

def _ordered_intersection(items: Iterable[str], wanted: set[str]) -> list[str]:
    result: list[str] = []
    for item in items:
        if item in wanted and item not in result:
            result.append(item)
    return result


def taste_score(candidate: dict[str, Any], taste_text: str | None) -> tuple[int, list[str], list[str], list[str]]:
    prefer_tags, user_avoid_tags = parse_user_taste(taste_text)
    if not (prefer_tags or user_avoid_tags):
        return 0, [], [], []

    positive_tags = canonicalize_tags([
        *normalize_list(candidate.get("taste_tags")),
        *normalize_list(candidate.get("tags")),
    ])
    project_avoid_tags = canonicalize_tags([

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…