def is_subject(token1, token2):
    """Return True if `token1` is the subject of `token2`."""
    return (
        (token1.upos in ["NOUN", "PRON"])
        and (token1.deprel == "nsubj")
        and (token1.head == token2.id)
    )