def _apply_cutoff(self, ratings: pd.DataFrame, scoredNotes: pd.DataFrame) -> pd.DataFrame:
    """Filter a ratings DF to only contain ratings before an applicable cutoff.

    Args:
      ratings: pd.DataFrame containing peer and/or local ratings.
      scoredNotes: pd.DataFrame specifying scoring cutoff timestamps
    """
    assert scoredNotes[_SCORING_CUTOFF_MTS].isna().sum() == 0
    beforeMerge = len(ratings)
    ratings = ratings.merge(scoredNotes[[c.noteIdKey, _SCORING_CUTOFF_MTS]])
    assert len(ratings) == beforeMerge
    return ratings[ratings[c.createdAtMillisKey] <= ratings[_SCORING_CUTOFF_MTS]].drop(
      columns=_SCORING_CUTOFF_MTS
    )
Filter a ratings DF to only contain ratings before an applicable cutoff.

    Args:
      ratings: pd.DataFrame containing peer and/or local ratings.
      scoredNotes: pd.DataFrame specifying scoring cutoff timestamps
    
sourcecode/scoring/pflip_plus_model.py