def METHOD_NAME(
    df: pandas.DataFrame,
    labels: bool,
    id_column_name: str,
    label_column_name: str,
    label_to_id: Mapping[str, int],
) -> Iterable[str]:
    if id_column_name in df.columns:
        yield id_column_name
        # check value range entity IDs
        assert df[id_column_name].isin(label_to_id.values()).all()
        if labels:
            yield label_column_name
            # check value range entity labels
            assert df[label_column_name].isin(label_to_id.keys()).all()