def has_gendered_nouns(doc):
    """
    Doc-level spaCy attribute getter, which returns True if
    any Token with a NOUN pos_ tag is of "m" or "f" gender.
    """
    noun_genders = [token._.gender for token in doc if token.pos_ in ["NOUN", "PROPN"]]
    has_gendered_noun = any([g in ["m", "f"] for g in noun_genders])
    return has_gendered_noun