def property_in_axes_text(
    property, property_str, target_txt, ax: mpl.axes.Axes
) -> bool:
    """
    Return True if the specified text in an axes
    has the property assigned to property_str
    """
    alltxt: list[mpl.text.Text] = ax.findobj(mpl.text.Text)
    return all(
        plt.getp(t, property) == property_str
        for t in alltxt
        if t.get_text() == target_txt
    )

    Return True if the specified text in an axes
    has the property assigned to property_str
    
xarray/tests/test_plot.py